Skip to content

fix: propagate subagent output length errors - #38726

Closed
yixiao5428 wants to merge 7 commits into
anomalyco:devfrom
lihaokun:yixiao-issue-1
Closed

fix: propagate subagent output length errors#38726
yixiao5428 wants to merge 7 commits into
anomalyco:devfrom
lihaokun:yixiao-issue-1

Conversation

@yixiao5428

Copy link
Copy Markdown

Summary

  • persist provider length finishes as terminal session errors while preserving partial output and preventing automatic replay
  • propagate child assistant failures through foreground and background tasks, preserve cancellation semantics, and escape model-controlled task markup
  • align reasoning output envelopes and numeric thinking budgets across provider transports while preserving plugin overrides
  • document the output-token behavior and synchronize all 17 existing localized CLI pages

Behavior

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 max thinking variants reserve visible-output headroom, respect provider bounds, and account for SDK transports that add thinking tokens back to the wire maximum.

Validation

  • 12 affected test files: 687 passed, 2 skipped, 0 failed
  • packages/opencode: bun run typecheck
  • packages/web: bun run build across 18 languages and 648 pages
  • pre-push full workspace typecheck: 30 of 30 tasks passed

Detailed reproduction, invariants, implementation decisions, and test coverage are recorded in docs/fixes/subagent-fix-output-length.md.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@yixiao5428 yixiao5428 closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant