diff --git a/symai/backend/engines/neurosymbolic/anthropic/engine.py b/symai/backend/engines/neurosymbolic/anthropic/engine.py index 24cfd7aa..d95cc04e 100644 --- a/symai/backend/engines/neurosymbolic/anthropic/engine.py +++ b/symai/backend/engines/neurosymbolic/anthropic/engine.py @@ -392,9 +392,24 @@ def _build_thinking_config(self, thinking_arg, model, spec): thinking_type = thinking_arg.get("type") if thinking_type == "disabled": + if model == "claude-fable-5": + # Fable rejects an explicit {"type": "disabled"} (thinking is + # always on); omitting the parameter is the closest valid form. + logger.warning( + "Thinking cannot be disabled on claude-fable-5; omitting the thinking parameter." + ) + return None, None return {"type": "disabled"}, None - if model in {"claude-opus-4-8", "claude-opus-4-7"}: + # Models where manual thinking (budget_tokens) is removed entirely — any + # thinking request is coerced to adaptive (budget_tokens returns 400 there). + if model in { + "claude-fable-5", + "claude-opus-5", + "claude-sonnet-5", + "claude-opus-4-8", + "claude-opus-4-7", + }: return {"type": "adaptive"}, thinking_arg.get("effort") if thinking_type == "adaptive": diff --git a/symai/backend/engines/neurosymbolic/anthropic/models.py b/symai/backend/engines/neurosymbolic/anthropic/models.py index bf29dc7c..ec123d00 100644 --- a/symai/backend/engines/neurosymbolic/anthropic/models.py +++ b/symai/backend/engines/neurosymbolic/anthropic/models.py @@ -52,6 +52,20 @@ class AnthropicModelSpec: sampling=False, pricing=ModelPricing(input=10.00, output=50.00, cached_input=1.00), ), + "claude-opus-5": AnthropicModelSpec( + context_tokens=LONG_CONTEXT_1M_TOKENS, + response_tokens=128_000, + reasoning=True, + vision=True, + # NOTE: thinking is on by default (an omitted `thinking` runs adaptive); + # `disabled` is only accepted at effort high or lower. Sampling kwargs + # are rejected as deprecated. + adaptive_thinking=True, + long_context_1m=True, + default_long_context_1m=True, + sampling=False, + pricing=ModelPricing(input=5.00, output=25.00, cached_input=0.50), + ), "claude-sonnet-5": AnthropicModelSpec( context_tokens=LONG_CONTEXT_1M_TOKENS, response_tokens=128_000,