Repository navigation
fix(task): return task_id when subagent run errors - #13958
weiguangli-io wants to merge 1 commit into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Closing due to inactivity. Happy to reopen if there's interest. |
|
There's interest from me, at least; I don't currently see any way to correct an in-flight subagent doing something wrong, without losing all of its context and work? All three of the approaches I am used to for this in Claude Code seem to be absent:
|
|
@weiguangli-io Interest from me too! Seems crazy that this hasn't been implemented before, it's so frustrating having to choose between losing all subagent context or allowing it to keep running on a misguided path. |
|
@weiguangli-io showing interest here. i see no reason why this feature shouldn't be implemented, and a lot of reasons why it should. i mean, why should sub-agents lose all of their work on session interruptions? and what's the reasoning behind keeping this behavior? to me it seems like a purely QoL feature that would prevent having to re-start interrupted sub-agents when they could instead be resumed. |
Fixes #13910
Summary
This keeps the task tool recoverable when a subagent run fails.
SessionPrompt.prompt()inpackages/opencode/src/tool/task.tswith error handlingtask_idWhy
Issue #13910 reports that when subagent execution throws (cancel/timeout/provider error), the parent agent loses the session handle and cannot resume with
task_id.This change guarantees that
task_idis always returned, so the parent can retry/inspect the same subagent session.Fixes #13910
Testing
cd packages/opencode && bun test test/tool/task.test.tscd packages/opencode && bun run typecheck(Repository-wide pre-push hook typecheck fails in this local environment due missing
@typescript/native-preview-darwin-x64, but the package-local checks above passed.)