Files
cursor-byok/internal/backend/agent/model
kael-odin 50ab63de3d fix(anthropic): apply thinking config on override path, symmetric with openai
AnthropicAdapter.Stream built thinking config (buildAnthropicThinkingConfig)
and wrote it into body only inside the `if len(body)==0` normal-construction
block. The RequestBodyOverride branch skipped it entirely — a disabled effort
on the override path left whatever thinking config the override body carried,
violating user intent and diverging from openai.go, where
applyOpenAIThinkingDisable runs unconditionally after both branches.

Also, on the normal path, disabled only wrote thinking:{type:disabled} but
left a stale output_config (set by a prior adaptive turn or by
AnthropicExtraParams) in place — an explicitly disabled request could still
carry output_config.effort=high, a contradictory payload.

Fix:
- Extract applyAnthropicThinkingConfig(body, req), called unconditionally
  after the override/normal block, mirroring openai.go:1860.
- disabled: force thinking:{type:"disabled"}, delete output_config, set
  thinking_disabled_provider_param=thinking.type knob.
- adaptive (AnthropicThinkingEffort non-empty): write
  thinking:{type:adaptive,display:summarized} + output_config.
- empty effort: no-op.
- buildAnthropicThinkingConfig retained for stable-message-count / message
  normalization signals inside the normal block.

Tests: anthropic_thinking_disable_test.go covers all three branches, alias
normalization (off→disabled), disabled overriding existing adaptive config,
and the override-path symmetry scenario.
2026-07-08 09:12:03 +08:00
..
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00
2026-06-30 10:38:52 +08:00