fix(tools): expose maxTurns on the subagent tool params (v0.9.3) - #13
Merged
Merged
Conversation
The subagent tool was hard-capped at 20 turns (DEFAULT_MAX_TURNS) with no way for the caller to raise it. Complex tasks (read a large file + plan + implement + test + commit) routinely hit the budget mid-task — Tasks 5/6/10 in the SPEC-6-1 dogfood all hit it. Claude Code's Task tool has no such tight cap. Expose maxTurns as an optional param (default 20 unchanged) so the model can raise it (e.g. 40) for complex multi-step tasks. Threaded through both the foreground delegate + lifecycle spawn paths.
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.
The
subagenttool was hard-capped at 20 turns (DEFAULT_MAX_TURNS) with no way for the caller to raise it. Complex multi-step tasks routinely hit the budget mid-task. Claude Code's Task tool has no such tight cap.Expose
maxTurnsas an optional param (default 20 unchanged) so the model can raise it (e.g. 40) for complex tasks. Threaded through the foreground delegate + lifecycle spawn paths.Why
Dogfooding fleet to build SPEC-6-1 — Tasks 5/6/10 all hit the 20-turn budget. The controller needs a way to raise the cap per-task.
Verification
313/313 tests pass, typecheck clean. Default unchanged (back-compat).