fix: split browser-safe thinking helpers

This commit is contained in:
Peter Steinberger 2026-03-16 08:50:27 +00:00
parent 43c156e43b
commit 6f5369c7e8
2 changed files with 16 additions and 0 deletions

View File

@ -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;
};

View File

@ -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({