diff --git a/src/agents/transcript-policy.test.ts b/src/agents/transcript-policy.test.ts index 32fedb9adc5..ea99bbbf590 100644 --- a/src/agents/transcript-policy.test.ts +++ b/src/agents/transcript-policy.test.ts @@ -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",