From f25bbbc37eb412b35093d8c1dfe44f714d2ecbe2 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 18 Feb 2026 04:37:50 +0100 Subject: [PATCH] feat: switch anthropic onboarding defaults to sonnet --- src/commands/auth-choice.apply.anthropic.ts | 9 +++++++++ src/commands/configure.gateway-auth.ts | 4 ++-- src/commands/model-picker.ts | 11 +++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/commands/auth-choice.apply.anthropic.ts b/src/commands/auth-choice.apply.anthropic.ts index 666f6614d1..b910768ea0 100644 --- a/src/commands/auth-choice.apply.anthropic.ts +++ b/src/commands/auth-choice.apply.anthropic.ts @@ -6,8 +6,11 @@ import { } from "./auth-choice.api-key.js"; import type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.js"; import { buildTokenProfileId, validateAnthropicSetupToken } from "./auth-token.js"; +import { applyAgentDefaultModelPrimary } from "./onboard-auth.config-shared.js"; import { applyAuthProfileConfig, setAnthropicApiKey } from "./onboard-auth.js"; +const DEFAULT_ANTHROPIC_MODEL = "anthropic/claude-sonnet-4-6"; + export async function applyAuthChoiceAnthropic( params: ApplyAuthChoiceParams, ): Promise { @@ -55,6 +58,9 @@ export async function applyAuthChoiceAnthropic( provider, mode: "token", }); + if (params.setDefaultModel) { + nextConfig = applyAgentDefaultModelPrimary(nextConfig, DEFAULT_ANTHROPIC_MODEL); + } return { config: nextConfig }; } @@ -94,6 +100,9 @@ export async function applyAuthChoiceAnthropic( provider: "anthropic", mode: "api_key", }); + if (params.setDefaultModel) { + nextConfig = applyAgentDefaultModelPrimary(nextConfig, DEFAULT_ANTHROPIC_MODEL); + } return { config: nextConfig }; } diff --git a/src/commands/configure.gateway-auth.ts b/src/commands/configure.gateway-auth.ts index 14f39229d7..d39f6ef624 100644 --- a/src/commands/configure.gateway-auth.ts +++ b/src/commands/configure.gateway-auth.ts @@ -29,8 +29,8 @@ function sanitizeTokenValue(value: string | undefined): string | undefined { } const ANTHROPIC_OAUTH_MODEL_KEYS = [ - "anthropic/claude-opus-4-6", "anthropic/claude-sonnet-4-6", + "anthropic/claude-opus-4-6", "anthropic/claude-opus-4-5", "anthropic/claude-sonnet-4-5", "anthropic/claude-haiku-4-5", @@ -121,7 +121,7 @@ export async function promptAuthConfig( config: next, prompter, allowedKeys: anthropicOAuth ? ANTHROPIC_OAUTH_MODEL_KEYS : undefined, - initialSelections: anthropicOAuth ? ["anthropic/claude-opus-4-6"] : undefined, + initialSelections: anthropicOAuth ? ["anthropic/claude-sonnet-4-6"] : undefined, message: anthropicOAuth ? "Anthropic OAuth models" : undefined, }); if (allowlistSelection.models) { diff --git a/src/commands/model-picker.ts b/src/commands/model-picker.ts index c5ed31339b..ebf6623698 100644 --- a/src/commands/model-picker.ts +++ b/src/commands/model-picker.ts @@ -151,6 +151,14 @@ function addModelSelectOption(params: { params.seen.add(key); } +function isAnthropicLegacyModel(entry: { provider: string; id: string }): boolean { + return ( + entry.provider === "anthropic" && + typeof entry.id === "string" && + entry.id.toLowerCase().startsWith("claude-3") + ); +} + async function promptManualModel(params: { prompter: WizardPrompter; allowBlank: boolean; @@ -251,6 +259,9 @@ export async function promptDefaultModel( if (hasPreferredProvider && preferredProvider) { models = models.filter((entry) => entry.provider === preferredProvider); + if (preferredProvider === "anthropic") { + models = models.filter((entry) => !isAnthropicLegacyModel(entry)); + } } const agentDir = params.agentDir;