fix(agents): keep tool-call repair scoped by transport

This commit is contained in:
Ted Li
2026-04-22 11:04:38 -07:00
committed by Peter Steinberger
parent 49c7319ea5
commit 2ba43f5d27
2 changed files with 11 additions and 1 deletions

View File

@@ -28,4 +28,13 @@ describe("shouldRepairMalformedToolCallArguments", () => {
}),
).toBe(false);
});
it("keeps kimi providers off on non-anthropic non-openai-completions transports", () => {
expect(
shouldRepairMalformedToolCallArguments({
provider: "kimi-coding",
modelApi: "openai-responses",
}),
).toBe(false);
});
});

View File

@@ -299,7 +299,8 @@ export function shouldRepairMalformedToolCallArguments(params: {
modelApi?: string | null;
}): boolean {
return (
normalizeProviderId(params.provider ?? "") === "kimi" ||
(normalizeProviderId(params.provider ?? "") === "kimi" &&
params.modelApi === "anthropic-messages") ||
params.modelApi === "openai-completions"
);
}