feat(tool): configurable timeout protection for tool and task execution#20103
Open
ESRE-dev wants to merge 1 commit intoanomalyco:devfrom
Open
feat(tool): configurable timeout protection for tool and task execution#20103ESRE-dev wants to merge 1 commit intoanomalyco:devfrom
ESRE-dev wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
- Add raceSignal() utility for clean abort-signal racing - Wrap non-task tool execution with configurable timeout (default 15min) - Add task-level deadline management with timeout recovery - Support experimental.tool_timeout and experimental.task_timeout config - Task tool manages its own deadline, skips outer timeout wrapper
98cf4c1 to
73296e3
Compare
avion23
pushed a commit
to avion23/opencode
that referenced
this pull request
Apr 2, 2026
…nomalyco#20104, anomalyco#20103) - SessionActivity tracker for per-session activity timestamps - Watchdog tick (60s) with leaf-filtering to force-error stuck tools - Idle detection (default 5min) cancels unresponsive subagent sessions - Orphan cleanup on startup for crash recovery - raceSignal() for abort-aware tool execution with configurable timeouts - Non-task tools: 15min global timeout (configurable) - Task tools: 4hr default timeout with partial output recovery - Fixed pre-existing typecheck error in app.tsx (removed externalOutputMode)
6 tasks
avion23
pushed a commit
to avion23/opencode
that referenced
this pull request
Apr 3, 2026
…ssions (anomalyco#20104, anomalyco#20103)" This reverts commit ab7ff56.
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.
Issue for this PR
Closes #15080
Type of change
What does this PR do?
Adds configurable timeout protection for both normal tool execution and subagent task execution to prevent indefinite hangs.
Key changes:
Shared abort utility
raceSignal(...)helper that cleanly races async work against an abort signal.Global non-task tool timeout
experimental.tool_timeout.taskexcluded from this outer timeout so it can manage its own deadline.Task tool deadline management
experimental.task_timeout.task_id.Config schema updates
Related overlap (not duplicates):
How did you verify your code works?
packages/opencode/test/tool/timeout.test.ts.Screenshots / recordings
Not a UI change.
Checklist
If you do not follow this template your PR will be automatically rejected.