[BUG] opusplan fails with 400 error when ANTHROPIC_DEFAULT_OPUS_MODEL points to 4.7 using the new thinking API format
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Using /model opusplan crashes with a 400 API error when ANTHROPIC_DEFAULT_OPUS_MODEL is set to a model that requires the new adaptive thinking API format (e.g. claude-opus-4-7).
Claude Code sends thinking.type.enabled but newer models require thinking.type.adaptive + output_config.effort. Models that have adopted the new thinking API require thinking: { type: "adaptive" } + output_config: { effort: "..." } instead.
What Should Happen?
opusplan works with claude-opus-4-7, using the new thinking API format. Models that have adopted the new thinking API require thinking: { type: "adaptive" } + output_config: { effort: "..." } instead.
Error Messages/Logs
API Error: 400
{"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":"req_011Ca8FdBuWpqDJZZbMQnhiS"}
Steps to Reproduce
- Set ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7 via
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7or in~/.zshrc - run claude > /model opusplan
- ask Claude to enter planning mode i.e. "go into planning mode" > 400 error
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.109
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗