[BUG] Agent per-invocation model schema rejects [1m] values accepted by subagent profiles

Open 💬 0 comments Opened Jul 12, 2026 by Jakepawl

Environment

  • Claude Code 2.1.207
  • Parent initialization reports claude-fable-5[1m]
  • Anthropic-compatible custom provider

Reproduction

  1. Create a custom subagent whose frontmatter model is a valid 1M model.
  2. Invoke it through the Agent tool and set the per-call model to sonnet[1m].
  3. The same result occurs when a PreToolUse hook rewrites a bare sonnet value to sonnet[1m] through hookSpecificOutput.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 model field 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].

View original on GitHub ↗