From 6f5369c7e8a15199265966b0774fb203cb7feb22 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Mar 2026 08:50:27 +0000 Subject: [PATCH] fix: split browser-safe thinking helpers --- extensions/slack/src/message-action-dispatch.ts | 3 +++ src/auto-reply/thinking.test.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/extensions/slack/src/message-action-dispatch.ts b/extensions/slack/src/message-action-dispatch.ts index b251d0b80eb..58fc4d77184 100644 --- a/extensions/slack/src/message-action-dispatch.ts +++ b/extensions/slack/src/message-action-dispatch.ts @@ -187,6 +187,9 @@ export async function handleSlackMessageAction(params: { const channelId = readStringParam(actionParams, "channelId") ?? readStringParam(actionParams, "to", { required: true }); + if (!channelId) { + throw new Error("channelId required"); + } return normalizeChannelId ? normalizeChannelId(channelId) : channelId; }; diff --git a/src/auto-reply/thinking.test.ts b/src/auto-reply/thinking.test.ts index 35d1c289271..a6867d1d9b8 100644 --- a/src/auto-reply/thinking.test.ts +++ b/src/auto-reply/thinking.test.ts @@ -118,6 +118,10 @@ describe("listThinkingLevelLabels", () => { expect(listThinkingLevelLabels("zai", "glm-4.7")).toEqual(["off", "on"]); }); + it("keeps built-in binary thinking fallback without provider runtime", () => { + expect(listThinkingLevelLabels("zai", "glm-4.7")).toEqual(["off", "on"]); + }); + it("returns full levels for non-ZAI", () => { expect(listThinkingLevelLabels("openai", "gpt-4.1-mini")).toContain("low"); expect(listThinkingLevelLabels("openai", "gpt-4.1-mini")).not.toContain("on"); @@ -157,6 +161,15 @@ describe("resolveThinkingDefaultForModel", () => { ).toBe("adaptive"); }); + it("keeps built-in adaptive defaults without provider runtime", () => { + expect( + resolveThinkingDefaultForModel({ provider: "anthropic", model: "claude-opus-4-6" }), + ).toBe("adaptive"); + expect( + resolveThinkingDefaultForModel({ provider: "aws-bedrock", model: "claude-sonnet-4-6" }), + ).toBe("adaptive"); + }); + it("defaults reasoning-capable catalog models to low", () => { expect( resolveThinkingDefaultForModel({