fix(task): propagate subagent provider errors to orchestrator#18509
fix(task): propagate subagent provider errors to orchestrator#18509Haohao-end wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
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: Potential Duplicate PRs Found#18444 - fix(tui): surface sub-agent provider errors in parent task flow
#17577 - feat(opencode): add model override for task tool subagents
#13321 - fix: robust subagent completion propagation
I recommend reviewing #18444 most closely as it appears to be addressing the same issue from a different angle. |
|
CI is currently failing on unrelated existing typecheck errors in packages/app:
My change only touches:
Local validation for this fix:
|
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Problem
Provider/model failures inside subagent sessions were not reaching the primary orchestrator, so the parent could continue spinning instead of surfacing the real error.
Root cause
TaskTool.execute()treated the child session result as a successful assistant text response and ignoredchildAssistant.info.error, which downgraded provider failures into empty task results.Fix
After
SessionPrompt.prompt(...)returns,TaskTool.execute()now checks forinfo.errorand throws a normalErrorwith the child error message. Successful child responses still follow the existingtask_id + <task_result>path unchanged.Validation
bun test test/tool/task.test.ts