From 2d8b4a9d53774f47b13943ea3a5f1e1f1d806d54 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 12 Apr 2026 02:29:18 +0900 Subject: [PATCH] fix(anthropic-effort): skip effort injection for github-copilot provider (#3270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit github-copilot routes Claude models but rejects the Anthropic effort parameter. Added an explicit guard so effort is no longer injected when the provider ID is github-copilot, while preserving native Anthropic provider support. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode --- src/hooks/anthropic-effort/hook.ts | 1 + src/hooks/anthropic-effort/index.test.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/hooks/anthropic-effort/hook.ts b/src/hooks/anthropic-effort/hook.ts index 31b18c7e6..6d4cc965c 100644 --- a/src/hooks/anthropic-effort/hook.ts +++ b/src/hooks/anthropic-effort/hook.ts @@ -65,6 +65,7 @@ export function createAnthropicEffortHook() { if (isEffortUnsupportedModel(model.modelID)) return if (message.variant !== "max") return if (!isClaudeProvider(model.providerID, model.modelID)) return + if (model.providerID === "github-copilot") return if (shouldSkipForInternalAgent(agent?.name)) return if (output.options.effort !== undefined) return diff --git a/src/hooks/anthropic-effort/index.test.ts b/src/hooks/anthropic-effort/index.test.ts index 5ca923cd2..cea012eb9 100644 --- a/src/hooks/anthropic-effort/index.test.ts +++ b/src/hooks/anthropic-effort/index.test.ts @@ -148,6 +148,22 @@ describe("createAnthropicEffortHook", () => { expect(output.options.effort).toBeUndefined() }) + it("#given github-copilot + claude model #then effort NOT injected", async () => { + // given + const hook = createAnthropicEffortHook() + const { input, output } = createMockParams({ + providerID: "github-copilot", + modelID: "claude-opus-4-6", + }) + + // when + await hook["chat.params"](input, output) + + // then + expect(output.options.effort).toBeUndefined() + expect(input.message.variant).toBe("max") + }) + describe("#given haiku models (effort unsupported)", () => { const haikuModels = [ "claude-haiku-4-5",