feat: add opusplan runtime verification and upstream bug case study (Issue #1223)#1489
feat: add opusplan runtime verification and upstream bug case study (Issue #1223)#1489konard wants to merge 7 commits into
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #1223
Deep investigation of the opusplan mode failure. Root cause identified: Claude Code CLI v2.1.86 does not implement model switching for opusplan - it accepts the alias but resolves to claude-sonnet-4-6 without enabling Opus for planning. This is confirmed by multiple upstream issues (anthropics/claude-code#16982, #35650, #33401). Includes full log analysis data from a real-world test session showing zero Opus API calls despite correct env var configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When using opusplan mode (--plan flag), the code now: - Verifies the actual model reported in Claude CLI's init event - Warns if Claude Code resolved opusplan to sonnet instead of opus (known upstream bug: anthropics/claude-code#16982, #35650) - Shows the plan/execution model split in command details display instead of just the worker model name This helps users detect when opusplan silently falls back to sonnet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests the warning condition logic that detects when Claude CLI reports a non-opus model despite opusplan being requested. Covers sonnet, opus, haiku, and non-opusplan model scenarios. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
opusplanCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Compact comments and condense opusplan verification to stay within the 1500-line CI limit while preserving all functionality. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 03b5635.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (3281KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit or discard them. Uncommitted files: Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback. |
🔄 Auto-restart 1/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (3634KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Looks like it does not work at all, may be we should add these to Claude Code issue we have created, so there that is really easy to reproduce. We can also try to make this mode work ourselves, as alternative mode like with opus, after that we need to find a way to switch to sonnet for execution. May be Looks like it is only about permissions: https://gist.github.com/konard/1b7b4bedb285a69cc1c54169364d73ef So in addition to So we can do alternative experimental Also in So in short opus should do only planing, including planing for questions, but it should present the entire plan, that will also plan for different answer possibilities. And sonnet will do the execution, including question asking if needed. |
Summary
opusplanmode doesn't actually use Opus for planning. Confirmed it's an upstream bug in Claude Code CLI (not in hive-mind). Claude Code accepts--model opusplanbut resolves it toclaude-sonnet-4-6without enabling the plan-mode model switching.executeClaudeCommand()that checks the model reported in Claude CLI's init event and warns when opusplan silently falls back to sonnet.Claude OPUSPLAN (plan: claude-opus-4-6, exec: claude-sonnet-4-6)instead of justClaude SONNET.docs/case-studies/issue-1223/with timeline, log analysis, and references to 6 upstream issues confirming this bug.Evidence
From the full session log:
claude --model opusplanANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-6claude-opus-4-6claude-sonnet-4-6(bug)Upstream Issues
/model opusplanmaps to sonnet for both phasesTest plan
node tests/test-opusplan-support.mjs)src/claude.lib.mjsFixes #1223
This PR was created automatically by the AI issue solver