fix(delegation): harden subagents against truncated tool-call output - #20993
Closed
stefan-mcf wants to merge 1 commit into
Closed
fix(delegation): harden subagents against truncated tool-call output#20993stefan-mcf wants to merge 1 commit into
stefan-mcf wants to merge 1 commit into
Conversation
stefan-mcf
force-pushed
the
fix/delegation-max-tokens-truncation
branch
from
May 7, 2026 03:08
91891ae to
711abf4
Compare
stefan-mcf
force-pushed
the
fix/delegation-max-tokens-truncation
branch
from
May 7, 2026 09:15
711abf4 to
fe4729e
Compare
Author
|
Closing and replacing with two narrower PRs for cleaner review: the delegation/subagent truncation hardening remains in this PR branch history but is now updated as a focused delegation-only PR, and the separate compression continuity advisory change now lives in #21118. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
delegation.max_tokensWhy
This PR fixes a Hermes-side delegation robustness issue. When a subagent hits
finish_reason="length"while emitting tool-call arguments, Hermes correctly refuses to execute incomplete arguments, but operators need a documented child-specific output budget override to prevent repeated failures in code-edit-heavy lanes.This is not caused by incorrect user prompting. It is a Hermes-side hardening gap around truncated subagent tool-call output.
Test plan
python -m pytest tests/tools/test_delegate.py -q -k 'delegation_max_tokens or prompt_tells_subagents_to_avoid_oversized_tool_calls'python -m pytest tests/run_agent/test_run_agent.py -q -k 'truncated_tool_call'