From 782650b0365bdd41e4d3767084e158e529012c99 Mon Sep 17 00:00:00 2001 From: Dan Smolsky <78942835+Tarquinen@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:46:18 -0500 Subject: [PATCH] fix(core): keep catalog capabilities when a v1 model override sets only some (#62573) --- packages/core/src/v1/config/migrate.ts | 7 +------ packages/core/test/config/provider.test.ts | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/packages/core/src/v1/config/migrate.ts b/packages/core/src/v1/config/migrate.ts index a5ccf2e365e..43d8dade5be 100644 --- a/packages/core/src/v1/config/migrate.ts +++ b/packages/core/src/v1/config/migrate.ts @@ -230,14 +230,9 @@ function migrateModel(info: typeof ConfigProviderV1.Model.Type, npm: string | un ] : []), ] - const defaults = Model.Capabilities.default() const capabilities = info.tool_call !== undefined || info.modalities?.input !== undefined || info.modalities?.output !== undefined - ? { - tools: info.tool_call ?? defaults.tools, - input: info.modalities?.input ?? defaults.input, - output: info.modalities?.output ?? defaults.output, - } + ? { tools: info.tool_call, input: info.modalities?.input, output: info.modalities?.output } : undefined return { modelID: info.id, diff --git a/packages/core/test/config/provider.test.ts b/packages/core/test/config/provider.test.ts index 8c2a2ce12ee..f68654c6956 100644 --- a/packages/core/test/config/provider.test.ts +++ b/packages/core/test/config/provider.test.ts @@ -765,6 +765,28 @@ describe("ConfigProviderPlugin.Plugin", () => { }), ) + it.effect("keeps catalog capabilities that a migrated override omits", () => + Effect.gen(function* () { + const providers = yield* Provider.Service + const models = yield* Model.Service + const providerID = Provider.ID.make("custom") + const modelID = Model.ID.make("chat") + yield* providers.transform((editor) => { + editor.models.update(providerID, modelID, (model) => { + model.capabilities = { tools: false, input: ["audio"], output: ["audio"] } + }) + }) + const result = ConfigNormalize.normalize({ provider: { custom: { models: { chat: { tool_call: true } } } } }) + if (result.type !== "normalized") throw new Error("Expected normalized config") + yield* addPlugin([new Document({ type: "document", info: decode(result.encoded) })]) + expect((yield* models.get(providerID, modelID))?.capabilities).toEqual({ + tools: true, + input: ["audio"], + output: ["audio"], + }) + }), + ) + it.effect("lets a configured provider baseURL override catalog model baseURLs", () => Effect.gen(function* () { const providers = yield* Provider.Service