[BUG] Agent per-invocation model schema rejects [1m] values accepted by subagent profiles
Environment
- Claude Code 2.1.207
- Parent initialization reports
claude-fable-5[1m] - Anthropic-compatible custom provider
Reproduction
- Create a custom subagent whose frontmatter
modelis a valid 1M model. - Invoke it through the Agent tool and set the per-call
modeltosonnet[1m]. - The same result occurs when a
PreToolUsehook rewrites a baresonnetvalue tosonnet[1m]throughhookSpecificOutput.updatedInput.
Actual behavior
The Agent call fails schema validation before a child is created because the per-call model field accepts only bare aliases. The same agent profile succeeds when the per-call model key is omitted. A hook that removes the bare per-call key lets the profile frontmatter control dispatch successfully.
Expected behavior
The Agent per-call model field should accept the same 1M model values documented for agent profiles and --model, including [1m], or the documentation should explicitly state that per-call selection accepts only bare aliases and cannot preserve a profile's 1M selection.
Impact
Callers and hooks cannot explicitly enforce a 1M subagent at dispatch time. A hook that tries to add the documented [1m] suffix causes deterministic schema failure. The profile-based workaround reduced one child's first input from approximately 140,700 tokens in prior inherited general-purpose runs to 20,499 tokens, but that comparison measures fixed overhead, not independent proof of the upstream context window.
Native Anthropic re-verification is currently limited by quota fallback through the custom provider, so I am not claiming that the successful child independently proved its upstream model or context-window size.
Related reports and request
- #31027 covers restoration of the Agent
modelfield with a bare-alias enum. - #40929 reports that an explicit bare subagent model can bypass the desired 1M/default selection.
- #46416 already covers custom-provider capability detection and early autocompaction, so that separate behavior is not being duplicated here.
Please widen the Agent schema to accept [1m], preserve the suffix through alias resolution, and add a regression test for PreToolUse updated input containing sonnet[1m].