diff --git a/packages/core/src/config/normalize.ts b/packages/core/src/config/normalize.ts index 3e0848042c5..caec9d4df38 100644 --- a/packages/core/src/config/normalize.ts +++ b/packages/core/src/config/normalize.ts @@ -149,7 +149,7 @@ export function normalize(input: unknown): Result { "agents", migratedAgents, nativeAgents, - isRecord(input.agent) || isRecord(input.mode) || isRecord(input.agents), + migratedSmallModel !== undefined || isRecord(input.agent) || isRecord(input.mode) || isRecord(input.agents), diagnostics, ) diff --git a/packages/core/test/config/normalization.test.ts b/packages/core/test/config/normalization.test.ts index cf94ae86e35..e1ce6c8201d 100644 --- a/packages/core/test/config/normalization.test.ts +++ b/packages/core/test/config/normalization.test.ts @@ -150,6 +150,16 @@ describe("ConfigNormalize", () => { }) test("migrates the legacy small model to the title agent", () => { + const result = normalized({ small_model: "anthropic/claude-haiku-4-5" }) + expect(result.encoded.agents).toEqual({ + title: { + model: { providerID: "anthropic", model: "claude-haiku-4-5" }, + }, + }) + expect(result.diagnostics).toEqual([]) + }) + + test("merges the legacy small model with the title agent", () => { const result = normalized({ small_model: "anthropic/claude-haiku-4-5", agent: { title: { prompt: "Custom title prompt" } },