fix: propagate subagent output length errors - #38726
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: Based on my search results, I found one potentially related PR: PR #26167: fix(session): retry empty stream truncations and discard partial parts
All other results returned PR #38726 (the current PR) itself or unrelated PRs. The search indicates this is primarily a unique fix addressing subagent output length propagation that doesn't have a direct duplicate in the open PRs. |
Summary
lengthfinishes as terminal session errors while preserving partial output and preventing automatic replayBehavior
A subagent that reaches the provider output limit now remains inspectable through its child session, but the parent task and top-level CLI correctly report failure instead of completed success. The fix does not replay requests, rerun tools, or expose reasoning text in parent diagnostics.
Reasoning models now use the declared model output limit by default. Numeric
maxthinking variants reserve visible-output headroom, respect provider bounds, and account for SDK transports that add thinking tokens back to the wire maximum.Validation
packages/opencode:bun run typecheckpackages/web:bun run buildacross 18 languages and 648 pagesDetailed reproduction, invariants, implementation decisions, and test coverage are recorded in
docs/fixes/subagent-fix-output-length.md.