MODULO 8.1

🧬 Model System

6
Topicos
~60
Minutos
Deep
Nivel
Source
Tipo
1

📋 Four-Provider Registry

Every model declared in ALL_MODEL_CONFIGS in configs.ts. Each entry is a ModelConfig record keyed by provider: firstParty, bedrock, vertex, foundry. @[MODEL LAUNCH] comment marks all seven files needing edits.

ProviderEnv VarModel Format
firstPartyDefaultclaude-opus-4-6
bedrockCLAUDE_CODE_USE_BEDROCK=1us.anthropic.claude-opus-4-6-v1
vertexCLAUDE_CODE_USE_VERTEX=1claude-opus-4-6
foundryCLAUDE_CODE_USE_FOUNDRY=1User-defined deployment IDs
2

🎯 Selection Priority Chain

1. /model command

Session override. Highest priority.

2. --model CLI flag

Sets override at startup.

3. ANTHROPIC_MODEL env var

Checked synchronously. Accepts aliases.

4. settings.json model field

Persisted across sessions.

5. Subscription default

Max/Team Premium → Opus 4.6. Others → Sonnet 4.6.

💡 Allowlist Gate

getUserSpecifiedModelSetting() checks model against settings.availableModels. If not on allowlist, silently ignored and default used.

3

🏷️ Aliases & [1m] Suffix

Aliases: sonnet, opus, haiku, best, opusplan, sonnet[1m], opus[1m]. The [1m] suffix signals 1M context window variant. Stripped at API boundary by normalizeModelStringForAPI().

💡 opusplan

Switches between Sonnet and Opus depending on permission mode. In plan mode, upgrades to Opus. haiku in plan mode silently upgrades to Sonnet.

4

🔋 1M Context & Effort Levels

Extended context is a runtime flag, not separate model. Access gated by subscription and extra-usage billing. Max/Team Premium get merged opus[1m] by default.

Effort: auto

Model default. No param sent.

Effort: low/medium/high

Thinking budget hints. Always persisted.

Effort: max

Opus 4.6 only. Session-scoped for non-ants.

5

🔄 Fast Mode & Allowlist

Fast mode: lower-latency execution for Opus 4.6 on first-party API only. Requires paid subscription + extra-usage billing. Statsig kill switch tengu_penguins_off.

💡 Allowlist Narrowing Rule

['opus', 'opus-4-5'] does NOT allow all Opus. Specific entry narrows the family wildcard to only opus-4-5.

6

⚡ Migrations & Subagent Inheritance

Migrations run on every startup, only touch userSettings (never project/policy). All idempotent. Subagents default to 'inherit' - parent's exact model string passed through including opusplan and Bedrock region prefix.

💡 Bedrock Region Prefix

Parent on eu.anthropic.claude-opus-4-6-v1? Subagent with alias 'sonnet' gets eu.anthropic.claude-sonnet-4-6 via applyParentRegionPrefix().

📋 Resumo do Modulo

One registry, four providers. ALL_MODEL_CONFIGS is single source of truth.
Selection has exactly five layers: /model → --model → ANTHROPIC_MODEL → settings → default.
The [1m] suffix is a runtime flag stripped at API boundary, not a separate model.
Effort and fast mode are orthogonal. Both have env-var overrides winning over UI settings.
Migrations only touch userSettings. Project and policy settings left alone.
Allowlist narrowing: specific entries suppress family wildcards for that family.
Voltar Proximo