feat: Implement stale validation cleanup and improve GitHub issue handling

- Added a scheduled task to clean up stale validation entries every hour, preventing memory leaks.
- Enhanced the `getAllValidations` function to read validation files in parallel for improved performance.
- Updated the `fetchLinkedPRs` function to use `spawn` for safer execution of GitHub CLI commands, mitigating shell injection risks.
- Modified event handling in the GitHub issues view to utilize the model for validation, ensuring consistency and reducing stale closure issues.
- Introduced a new property in the issue validation event to track the model used for validation.
This commit is contained in:
Kacper
2025-12-23 22:21:08 +01:00
parent 0c9f05ee38
commit d1418aa054
7 changed files with 85 additions and 27 deletions

View File

@@ -162,14 +162,14 @@ export function GitHubIssuesView() {
return next;
});
// Update cached validations (use event.issueTitle to avoid stale closure)
// Update cached validations (use event.model to avoid stale closure race condition)
setCachedValidations((prev) => {
const next = new Map(prev);
next.set(event.issueNumber, {
issueNumber: event.issueNumber,
issueTitle: event.issueTitle,
validatedAt: new Date().toISOString(),
model: validationModel,
model: event.model,
result: event.result,
});
return next;