Repository navigation
fix(task): report error to parent when subagent finishes with error (#52378) - #52678
JerryLiu369 wants to merge 2 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
|
The explicit On current V2 55dde881, the successfully ended stream synthesizes an assistant failure only for Would you be able to port the fix to the V2 owner and reuse |
…background delivery
|
@r266-tech Ported to the V2 owner path as requested, pushed to this branch:
Verification on this box: packages/opencode task suite 24/24 green, packages/core session-runner suite 88/88 green, scoped tsgo typecheck clean for both packages. Repo-wide bun typecheck cannot complete in this environment (tsgo exceeds 300s and gets SIGTERM), so that one is left to CI. |
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Issue for this PR
Closes #52378
Type of change
What does this PR do?
When a subagent assistant message ends with
finish: "error"without an expliciterrorobject,TaskTool.runTaskpreviously ignored the error finish status and fell through to returning empty text parts, reporting the subagent task as successfully completed (state="completed").This fix ensures
TaskTool.runTaskchecks forfinish === "error"on the assistant message and fails the task accordingly, surfacing the failure to the parent task runner withstate="error". Also adds a unit test intask.test.ts.How did you verify your code works?
bun test test/tool/task.test.tsinpackages/opencode. All 23 tests pass cleanly.Screenshots / recordings
N/A
Checklist