fix(anthropic-effort): skip effort injection for github-copilot provider (#3270)

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
This commit is contained in:
YeonGyu-Kim
2026-04-12 02:29:18 +09:00
parent 7e96af5f28
commit 2d8b4a9d53
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -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
+16
View File
@@ -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",