Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(models): pin thinkingLevelMap.off=null for effort-only ladders
ZxlDragonDoctorc535553a9568
diff --git a/apps/desktop/electron/main/models-dev-catalog.ts b/apps/desktop/electron/main/models-dev-catalog.tsindex e675f6076..99e9116a1 100644--- a/apps/desktop/electron/main/models-dev-catalog.ts+++ b/apps/desktop/electron/main/models-dev-catalog.ts@@ -266,6 +266,16 @@ function thinkingLevelMapFromModelsDev(if (level && typeof value === "string") map[level] = value;}}+ // models.dev effort ladders often omit an off/none value (e.g. grok-4.6).+ // Pin off=null so adapters omit reasoning when thinking is turned off,+ // instead of synthesizing effort: "none" which upstream rejects (#603).+ if (+ Object.keys(map).length > 0 &&+ map.off === undefined &&+ !levels.includes("off")+ ) {+ map.off = null;+ }return Object.keys(map).length > 0 ? map : undefined;}diff --git a/apps/desktop/test/models-dev-catalog.test.mjs b/apps/desktop/test/models-dev-catalog.test.mjsindex 0f7ab00d1..a2c72419c 100644--- a/apps/desktop/test/models-dev-catalog.test.mjs+++ b/apps/desktop/test/models-dev-catalog.test.mjs@@ -280,6 +280,8 @@ test("models.dev records retain all published model parameters and modalities",high: "high",xhigh: "xhigh",max: "max",+ // Effort ladder without a published none/off value (#603).+ off: null,});assert.deepEqual(info.provider, { npm: "@ai-sdk/anthropic" });assert.deepEqual(info.experimental, { modes: { fast: { enabled: true } } });@@ -315,6 +317,8 @@ test("models.dev records retain all published model parameters and modalities",high: "high",xhigh: "xhigh",max: "max",+ // Effort ladder without a published none/off value (#603).+ off: null,});assert.equal(config.cost.reasoning, 25);assert.deepEqual(config.provider, { npm: "@ai-sdk/anthropic" });