fix(anthropic-effort): skip effort injection for internal agents (fixes #2940)

Internal agents (title, summary, compaction) no longer receive the
anthropic-beta effort header, preventing 400 errors on Google Vertex
Anthropic provider.

Verified: 12 tests pass, typecheck clean
This commit is contained in:
YeonGyu-Kim
2026-03-30 10:33:32 +09:00
parent 7bf7b20444
commit 67253447b7
2 changed files with 27 additions and 1 deletions
+19
View File
@@ -108,6 +108,25 @@ describe("createAnthropicEffortHook", () => {
expect(output.options.effort).toBeUndefined()
})
describe("#given internal hidden agents", () => {
const internalAgents = ["title", "summary", "compaction"] as const
for (const agentName of internalAgents) {
it(`skips effort injection for ${agentName} agent`, async () => {
// given
const hook = createAnthropicEffortHook()
const { input, output } = createMockParams({ agentName })
// when
await hook["chat.params"](input, output)
// then
expect(output.options.effort).toBeUndefined()
expect(input.message.variant).toBe("max")
})
}
})
it("should clamp effort to high for non-opus claude model with variant max", async () => {
//#given claude-sonnet-4-6 (not opus) with variant max
const hook = createAnthropicEffortHook()