diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts index 308205193d..dd25775cac 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts @@ -416,7 +416,6 @@ describe("ProviderCommandReactor", () => { expect(harness.startSession.mock.calls[0]?.[1]).toMatchObject({ provider: "claudeCode", cwd: "/tmp/provider-project", - model: "gpt-5-codex", runtimeMode: "approval-required", }); diff --git a/apps/server/src/provider/Layers/ClaudeCodeAdapter.ts b/apps/server/src/provider/Layers/ClaudeCodeAdapter.ts index c4bc93a9fe..7e21884b8f 100644 --- a/apps/server/src/provider/Layers/ClaudeCodeAdapter.ts +++ b/apps/server/src/provider/Layers/ClaudeCodeAdapter.ts @@ -1816,7 +1816,7 @@ function makeClaudeCodeAdapter(options?: ClaudeCodeAdapterLiveOptions) { const stopAll: ClaudeCodeAdapterShape["stopAll"] = () => Effect.forEach( - sessions, + Array.from(sessions), ([, context]) => stopSessionInternal(context, { emitExitEvent: true, @@ -1826,7 +1826,7 @@ function makeClaudeCodeAdapter(options?: ClaudeCodeAdapterLiveOptions) { yield* Effect.addFinalizer(() => Effect.forEach( - sessions, + Array.from(sessions), ([, context]) => stopSessionInternal(context, { emitExitEvent: false, diff --git a/apps/web/src/appSettings.test.ts b/apps/web/src/appSettings.test.ts index da55af6ff7..60054264a6 100644 --- a/apps/web/src/appSettings.test.ts +++ b/apps/web/src/appSettings.test.ts @@ -8,12 +8,11 @@ import { } from "./appSettings"; describe("normalizeCustomModelSlugs", () => { - it("normalizes aliases, removes built-ins, and deduplicates values", () => { + it("removes literal built-ins, trims whitespace, and deduplicates values", () => { expect( normalizeCustomModelSlugs([ " custom/internal-model ", "gpt-5.3-codex", - "5.3", "custom/internal-model", "", null, @@ -21,8 +20,10 @@ describe("normalizeCustomModelSlugs", () => { ).toEqual(["custom/internal-model"]); }); - it("normalizes provider-specific aliases for claude", () => { - expect(normalizeCustomModelSlugs(["sonnet"], "claudeCode")).toEqual([]); + it("preserves aliases and dated versions as custom models", () => { + expect(normalizeCustomModelSlugs(["claude-sonnet-4-6-20251117"], "claudeCode")).toEqual([ + "claude-sonnet-4-6-20251117", + ]); expect(normalizeCustomModelSlugs(["claude/custom-sonnet"], "claudeCode")).toEqual([ "claude/custom-sonnet", ]); diff --git a/apps/web/src/appSettings.ts b/apps/web/src/appSettings.ts index 5c3e80ff77..40b267f810 100644 --- a/apps/web/src/appSettings.ts +++ b/apps/web/src/appSettings.ts @@ -57,18 +57,19 @@ export function normalizeCustomModelSlugs( const builtInModelSlugs = BUILT_IN_MODEL_SLUGS_BY_PROVIDER[provider]; for (const candidate of models) { - const normalized = normalizeModelSlug(candidate, provider); + if (typeof candidate !== "string") continue; + const trimmed = candidate.trim(); if ( - !normalized || - normalized.length > MAX_CUSTOM_MODEL_LENGTH || - builtInModelSlugs.has(normalized) || - seen.has(normalized) + !trimmed || + trimmed.length > MAX_CUSTOM_MODEL_LENGTH || + builtInModelSlugs.has(trimmed) || + seen.has(trimmed) ) { continue; } - seen.add(normalized); - normalizedModels.push(normalized); + seen.add(trimmed); + normalizedModels.push(trimmed); if (normalizedModels.length >= MAX_CUSTOM_MODEL_COUNT) { break; }