test: pin provider thinking replay boundaries

This commit is contained in:
Shakker
2026-04-12 05:31:34 +01:00
committed by Shakker
parent 01d092ff89
commit 1a041001d3

View File

@@ -16,6 +16,7 @@ vi.mock("../plugins/provider-runtime.js", async () => {
"amazon-bedrock",
"anthropic",
"google",
"github-copilot",
"kilocode",
"kimi",
"kimi-code",
@@ -109,6 +110,12 @@ vi.mock("../plugins/provider-runtime.js", async () => {
validateAnthropicTurns: false,
allowSyntheticToolResults: true,
};
case "github-copilot":
return modelId.includes("claude")
? {
dropThinkingBlocks: true,
}
: {};
case "mistral":
return {
sanitizeToolCallIds: true,
@@ -443,6 +450,34 @@ describe("resolveTranscriptPolicy", () => {
).toBe(true);
});
it("does not allow immutable provider-owned thinking replay for github-copilot claude models", () => {
const policy = resolveTranscriptPolicy({
provider: "github-copilot",
modelId: "claude-sonnet-4",
modelApi: "anthropic-messages",
});
expect(
shouldAllowProviderOwnedThinkingReplay({
modelApi: "anthropic-messages",
policy,
}),
).toBe(false);
});
it("does not allow immutable provider-owned thinking replay for openrouter models on openai replay", () => {
const policy = resolveTranscriptPolicy({
provider: "openrouter",
modelId: "anthropic/claude-sonnet-4-6",
modelApi: "openai-completions",
});
expect(
shouldAllowProviderOwnedThinkingReplay({
modelApi: "openai-completions",
policy,
}),
).toBe(false);
});
it("does not allow immutable provider-owned thinking replay for strict openai-compatible replay", () => {
const policy = resolveTranscriptPolicy({
provider: "vllm",