-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Evals] task error handling and memory cleanup #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Evals] task error handling and memory cleanup #1419
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
Greptile OverviewGreptile SummaryThis PR fixes critical error handling issues in the eval runner that were causing tasks to idle and memory leaks. Key improvements:
The changes follow clean error handling patterns: logs are captured in return statements before the finally block clears them, and cleanup always happens regardless of success or failure. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Runner as Eval Runner
participant Logger as EvalLogger
participant Task as Task Module
participant V3 as V3 Instance
Runner->>Logger: new EvalLogger()
Note over Runner: Declare v3Input at outer scope
alt Task Execution Success
Runner->>Task: import task module
Runner->>V3: initV3()
V3-->>Runner: v3Input
Runner->>Task: taskFunction(v3Input)
Task->>Logger: log events
Task-->>Runner: result { _success: true }
Runner->>Runner: console.log success
Runner-->>Runner: return result
else Task Execution Error
Runner->>Task: import or execute task
Task--xRunner: throws error
Runner->>Logger: logger.error()
Runner-->>Runner: return { _success: false, error, logs }
end
Note over Runner,V3: Finally block always runs
Runner->>V3: v3Input?.v3.close()
alt Close Success
V3-->>Runner: closed
else Close Error
V3--xRunner: closeError
Runner->>Runner: console.error (warning only)
end
Runner->>Logger: logger.clear()
Logger->>Logger: logs = [], stagehand = undefined
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
why
Error handling on tasks was causing the runner to idle. Also, proper log cleanup is needed to prevent memory leaks.
what changed
test plan
Summary by cubic
Improves eval task error handling and cleanup to prevent memory leaks and dangling V3 sessions. Always closes resources and clears logs after each task run.
Bug Fixes
Refactors
Written for commit 34aebe9. Summary will update automatically on new commits.