Basic checks
What's broken?
When using RubyLLM with newer Anthropic models (e.g. Opus 4.7), requests fail with the error:
Accumulating error chunk: {"type":"error","error":{"type":"invalid_request_error","message":""thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior."},"request_id":"..."}
The code currently always sets thinking: {type: "enabled"} in the payload (see lib/ruby_llm/providers/anthropic/chat.rb).
https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
How to reproduce
- Configure RubyLLM to use a newer Anthropic Claude model (e.g. Opus 4.7)
- Call
chat.with_thinking(...)
- Request fails with the error above
Expected behavior
RubyLLM should send thinking: {type: "adaptive"} with output_config.effort, as required by new Anthropic models. It should detect/model-switch as needed to remain compatible with all supported Claude versions.
What actually happened
RubyLLM sends the legacy format and Anthropic rejects the call. Error: "'thinking.type.enabled' is not supported for this model. Use 'thinking.type.adaptive' and 'output_config.effort' to control thinking behavior."
Environment
Basic checks
What's broken?
When using RubyLLM with newer Anthropic models (e.g. Opus 4.7), requests fail with the error:
Accumulating error chunk: {"type":"error","error":{"type":"invalid_request_error","message":""thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior."},"request_id":"..."}
The code currently always sets
thinking: {type: "enabled"}in the payload (seelib/ruby_llm/providers/anthropic/chat.rb).https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
How to reproduce
chat.with_thinking(...)Expected behavior
RubyLLM should send
thinking: {type: "adaptive"}withoutput_config.effort, as required by new Anthropic models. It should detect/model-switch as needed to remain compatible with all supported Claude versions.What actually happened
RubyLLM sends the legacy format and Anthropic rejects the call. Error: "'thinking.type.enabled' is not supported for this model. Use 'thinking.type.adaptive' and 'output_config.effort' to control thinking behavior."
Environment