From 0a4cfda7871f902bd858d30058e1597d7d4ea6b5 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Tue, 17 Feb 2026 14:56:41 -0800 Subject: [PATCH] feat: add claude-sonnet-4-6 (20260217) model support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - costs.ts: add claude-sonnet-4-6-20260217 at $3/$15 per 1M tokens, claude-sonnet-4.6 GitHub alias at $0 - models.ts: add anthropicToGitHubModel mapping for claude-sonnet-4-6-20260217 → claude-sonnet-4.6 - tokens.ts: add 1M token context window for claude-sonnet-4-6-20260217 - providers.ts: bump Anthropic, GitHub Models, and Bedrock default to sonnet-4-6 - AGENTS.md: update default subagent model from claude-sonnet-4.5 to claude-sonnet-4.6 --- AGENTS.md | 2 +- src/cli/setup/providers.ts | 6 +++--- src/context/tokens.ts | 1 + src/daemon/models.ts | 1 + src/models/costs.ts | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1761fbc..3284f46 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,7 +3,7 @@ ## General Rules - **Parallelise with subagents:** For every task, use multiple subagents with the appropriate model to work more efficiently. Dispatch independent subtasks in parallel rather than executing them sequentially. -- **Subagent model selection (MANDATORY):** You MUST use the right model tier for each subagent — `claude-haiku-4.5` for fast/simple/mechanical tasks, `claude-sonnet-4.5` for default/standard implementation work, and `claude-opus-4.6` for complex reasoning or architecture decisions. Never use the same model for all subagents. +- **Subagent model selection (MANDATORY):** You MUST use the right model tier for each subagent — `claude-haiku-4.5` for fast/simple/mechanical tasks, `claude-sonnet-4.6` for default/standard implementation work, and `claude-opus-4.6` for complex reasoning or architecture decisions. Never use the same model for all subagents. - **Minimize main agent context:** Always delegate tasks to subagents with the right model to execute each task more efficiently and keep the main agent context window usage minimum. The main agent should coordinate and synthesize, not perform detailed implementation work. - **Commit often:** `git commit` frequently — after each meaningful unit of work, not just at the end of a task. - **Commit structure:** Prefer small, atomic commits that each represent one meaningful unit of work. Keep unrelated changes out of the same commit. When a change affects docs/diagrams/state, update and commit those alongside the code change (not later). diff --git a/src/cli/setup/providers.ts b/src/cli/setup/providers.ts index 7017912..56a7b08 100644 --- a/src/cli/setup/providers.ts +++ b/src/cli/setup/providers.ts @@ -13,7 +13,7 @@ interface ProviderDef { } const TOP_TIER: ProviderDef[] = [ - { name: 'Anthropic', provider: 'anthropic', defaultModel: 'claude-sonnet-4-20250514', fastModel: 'claude-haiku-4-5-20251001', needsApiKey: true, needsEndpoint: false, apiKeyLabel: 'Anthropic API key' }, + { name: 'Anthropic', provider: 'anthropic', defaultModel: 'claude-sonnet-4-6-20260217', fastModel: 'claude-haiku-4-5-20251001', needsApiKey: true, needsEndpoint: false, apiKeyLabel: 'Anthropic API key' }, { name: 'OpenAI', provider: 'openai', defaultModel: 'gpt-4.1', fastModel: 'gpt-4.1-mini', needsApiKey: true, needsEndpoint: false, apiKeyLabel: 'OpenAI API key' }, { name: 'Ollama (local)', provider: 'ollama', defaultModel: 'llama3.3', fastModel: 'llama3.2:3b', needsApiKey: false, needsEndpoint: true, defaultEndpoint: 'http://localhost:11434' }, ]; @@ -26,8 +26,8 @@ const SECOND_TIER: ProviderDef[] = [ { name: 'xAI (Grok)', provider: 'xai', defaultModel: 'grok-3', fastModel: 'grok-3-mini', needsApiKey: true, needsEndpoint: false, apiKeyLabel: 'xAI API key' }, { name: 'MiniMax', provider: 'minimax', defaultModel: 'MiniMax-M1', needsApiKey: true, needsEndpoint: true, defaultEndpoint: 'https://api.minimax.io/v1', apiKeyLabel: 'MiniMax API key' }, { name: 'Moonshot (Kimi)', provider: 'moonshot', defaultModel: 'moonshot-v1-8k', needsApiKey: true, needsEndpoint: true, defaultEndpoint: 'https://api.moonshot.cn/v1', apiKeyLabel: 'Moonshot API key' }, - { name: 'Amazon Bedrock', provider: 'bedrock', defaultModel: 'anthropic.claude-sonnet-4-20250514-v1:0', needsApiKey: false, needsEndpoint: false }, - { name: 'GitHub Models', provider: 'github', defaultModel: 'claude-sonnet-4-20250514', needsApiKey: false, needsEndpoint: false }, + { name: 'Amazon Bedrock', provider: 'bedrock', defaultModel: 'anthropic.claude-sonnet-4-6-20260217-v1:0', needsApiKey: false, needsEndpoint: false }, + { name: 'GitHub Models', provider: 'github', defaultModel: 'claude-sonnet-4-6-20260217', needsApiKey: false, needsEndpoint: false }, ]; const PROVIDER_HELP: Record = { diff --git a/src/context/tokens.ts b/src/context/tokens.ts index 06e6a55..046bbcc 100644 --- a/src/context/tokens.ts +++ b/src/context/tokens.ts @@ -15,6 +15,7 @@ const DEFAULT_CONTEXT_WINDOW = 128_000; * Hard-coded context window sizes (in tokens) for known models. */ export const CONTEXT_WINDOWS: Record = { + 'claude-sonnet-4-6-20260217': 1_000_000, 'claude-sonnet-4-20250514': 200_000, 'claude-3-5-haiku-20241022': 200_000, 'claude-3-5-sonnet-20241022': 200_000, diff --git a/src/daemon/models.ts b/src/daemon/models.ts index d6061ea..fca69ed 100644 --- a/src/daemon/models.ts +++ b/src/daemon/models.ts @@ -259,6 +259,7 @@ export function anthropicToGitHubModel(anthropicModel: string): string | undefin // Sonnet family 'claude-sonnet-4-20250514': 'claude-sonnet-4', 'claude-sonnet-4-5-20250929': 'claude-sonnet-4.5', + 'claude-sonnet-4-6-20260217': 'claude-sonnet-4.6', // Opus family 'claude-opus-4-20250514': 'claude-opus-4', 'claude-opus-4-5-20250918': 'claude-opus-4.5', diff --git a/src/models/costs.ts b/src/models/costs.ts index 387282e..a22a6a1 100644 --- a/src/models/costs.ts +++ b/src/models/costs.ts @@ -1,6 +1,7 @@ /** Approximate cost per million tokens for known models. */ export const MODEL_COSTS_PER_MILLION: Record = { // Anthropic + 'claude-sonnet-4-6-20260217': { input: 3, output: 15 }, 'claude-sonnet-4-20250514': { input: 3, output: 15 }, 'claude-3-5-haiku-20241022': { input: 0.80, output: 4 }, 'claude-opus-4-20250514': { input: 15, output: 75 }, @@ -17,6 +18,7 @@ export const MODEL_COSTS_PER_MILLION: Record