Elffuss BraidHub

kikocis/continue public

Merge pull request #7175 from su0as/fix/openrouter-kimi-free-tools

fix: disable tool support for moonshotai/kimi-k2:free model
Changeset69c88f2069b9d3f0246bc870c8291a8de33a3e9c1445a0fe54b3d5ec2df75685
AuthorDallin Romney <dallinromney@gmail.com> · 2025-08-18 17:18 -07:00
CommitterGitHub <noreply@github.com> · 2025-08-18 17:18 -07:00
Parentsad58281a51c9, 19cfb6ec829a

Browse the files at this changeset

2 files changed

modified core/llm/toolSupport.test.ts +9 −0
@@ -280,6 +280,15 @@
280280 });
281281 });
282282
283+ describe("openrouter", () => {
284+ const supportsFn = PROVIDER_TOOL_SUPPORT["openrouter"];
285+
286+ it("should return false for moonshotai/kimi-k2:free model", () => {
287+ // This fixes issue #6619
288+ expect(supportsFn("moonshotai/kimi-k2:free")).toBe(false);
289+ });
290+ });
291+
283292 describe("edge cases", () => {
284293 it("should handle empty model names", () => {
285294 expect(PROVIDER_TOOL_SUPPORT["continue-proxy"]("")).toBe(false);
modified core/llm/toolSupport.ts +7 −0
@@ -239,6 +239,13 @@
239239 },
240240 openrouter: (model) => {
241241 // https://openrouter.ai/models?fmt=cards&supported_parameters=tools
242+
243+ // Specific free models that don't support tools
244+ // Fixes issue #6619 - moonshotai/kimi-k2:free causing 400 errors
245+ if (model.toLowerCase() === "moonshotai/kimi-k2:free") {
246+ return false;
247+ }
248+
242249 if (
243250 ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
244251 (part) => model.toLowerCase().includes(part),