fix(task-processor): prevent runaway tasks with 3 elapsed-time and to…#186
Merged
fix(task-processor): prevent runaway tasks with 3 elapsed-time and to…#186
Conversation
…ol-limit fixes
Bug 1: startTime reset on every auto-resume — each processTask() call
created a new TaskState with startTime=Date.now(), so the elapsed time
cap (15min free / 30min paid) never triggered across resumes. Fix:
preserve startTime from the original task when resuming.
Bug 2: elapsed time cap only checked when task appears stuck — the
alarm handler returned early ("still active") before reaching the
elapsed check. Fix: move elapsed check before the "still active"
early return so it fires regardless of task activity.
Bug 3: no total tool call limit — a model could make unlimited tool
calls across its lifetime. Fix: add MAX_TOTAL_TOOLS_FREE=50 and
MAX_TOTAL_TOOLS_PAID=100 with a nudge message when exceeded.
Also adds defense-in-depth elapsed check in the main processTask loop.
These bugs caused a 2-file GitHub read to take 46 minutes with 8
auto-resumes and 29 tool calls instead of stopping at the time cap.
https://claude.ai/code/session_01K2mQTABDGY7DnnposPdDjw
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




…ol-limit fixes
Bug 1: startTime reset on every auto-resume — each processTask() call created a new TaskState with startTime=Date.now(), so the elapsed time cap (15min free / 30min paid) never triggered across resumes. Fix: preserve startTime from the original task when resuming.
Bug 2: elapsed time cap only checked when task appears stuck — the alarm handler returned early ("still active") before reaching the elapsed check. Fix: move elapsed check before the "still active" early return so it fires regardless of task activity.
Bug 3: no total tool call limit — a model could make unlimited tool calls across its lifetime. Fix: add MAX_TOTAL_TOOLS_FREE=50 and MAX_TOTAL_TOOLS_PAID=100 with a nudge message when exceeded.
Also adds defense-in-depth elapsed check in the main processTask loop.
These bugs caused a 2-file GitHub read to take 46 minutes with 8 auto-resumes and 29 tool calls instead of stopping at the time cap.
https://claude.ai/code/session_01K2mQTABDGY7DnnposPdDjw