Repository navigation
refactor(engine): drop the deprecated Subagent max_tokens argument - #1634
Merged
Merged
Conversation
`max_tokens` was a DEPRECATED alias for `max_run_tokens` on the Subagent
tool: both named the same cumulative input+output RUN budget, while the
shorter name read as a provider single-response output ceiling it never
was. Remove it so there is exactly one per-call budget argument.
- `subagentArgs.MaxTokens` and the `max_tokens` schema property are gone.
- `resolveMaxRunTokens` no longer folds two aliases: it returns the single
positive value, or 0 for "inherit the engine budget". The two-alias
conflict rejection in `run()` ("set only one of max_run_tokens or the
deprecated max_tokens ...") is therefore removed with it.
- The three alias-only tests (backward-compat, conflict, same-value) are
dropped; the remaining budget tests move to `max_run_tokens`.
- Living docs (AGENTS.md, docs/architecture/*, IMPLEMENTATION-NOTES) and an
engine CHANGELOG "Removed" entry follow. ADR 0015 is left untouched — a
frozen ADR is superseded, never edited.
No exported identifier changes (`subagentArgs` is unexported), so
`task api:check` passes with no baseline update. Model-facing behaviour
change only: a call still emitting `max_tokens` now has that key ignored
and the child inherits the operator/engine budget.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…kens arg
TestSubagentPerCallMaxTokens{HitsBudgetTerminal,TightenOnly} named an
argument that no longer exists. Rename to MaxRunTokens, including the
cross-reference from TestSubagentResumeBudgetTightenOnly.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
You might wanna edit the notes to remove the comments about the field being removed. |
The notes are the living "how it works now" reference; a tombstone for a removed argument belongs in engine/CHANGELOG.md, which already records it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cosmetic only — restores the file's line wrapping where removing the alias text left short lines. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
JAORMX
approved these changes
Sep 16, 2026
Merged
2 tasks
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
Removes the deprecated
max_tokensargument from theSubagenttool. It was an alias formax_run_tokens— same cumulative input+output run budget — under a name that read as aprovider output-token cap. One argument now, so
resolveMaxRunTokensloses the two-aliasfold and the conflicting-values rejection with it.
Living docs and an engine CHANGELOG
Removedentry follow. ADR 0015 is untouched: frozenADRs get superseded, not edited.
Type of change
Test plan
task lint— 0 issues, all modulestask test— green except a pre-existing macOS-only failure fixed separately in test(app): resolve env(1) absolutely so the scrub probe survives a pinned PATH #1633go run ./cmd/mecademotask docstask api:check— passes unchanged;subagentArgsis unexported, so no baseline updateUser-facing change
A
Subagentcall still emittingmax_tokensnow has that key ignored; the child inheritsthe operator/engine budget. Use
max_run_tokens.