-
Notifications
You must be signed in to change notification settings - Fork 645
feat: add Claude Opus 4.5 model selection #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add model selection dropdown for Claude provider - Support switching between Opus 4.5 and Sonnet 4 - Update claude-agent-sdk to v0.1.60 for Opus 4.5 compatibility - Persist model preference in localStorage
WalkthroughUpdated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/ChatInterface.jsx (1)
2038-2090:executeCommandcloses overclaudeModelbut doesn’t list it in deps
context.modelswitches betweencursorModelandclaudeModel, but theuseCallbackdeps omitclaudeModel. If the user changes the Claude model and then runs a slash command,executeCommandcan still send the old model value until something else in the deps changes.Recommend adding
claudeModelto the dependency array:- }, [input, selectedProject, currentSessionId, provider, cursorModel, tokenBudget]); + }, [input, selectedProject, currentSessionId, provider, cursorModel, claudeModel, tokenBudget]);
🧹 Nitpick comments (2)
src/components/ChatInterface.jsx (2)
1702-1710: Claude model state + persistence wiring look goodInitializing
claudeModelfromlocalStorage('claude-model')and using it consistently in UI and payloads is sound. If you want full consistency with other persisted bits (like drafts/history), you could eventually route thesetItem/getItemcalls forclaude-modelthroughsafeLocalStorage, but it’s not required for correctness.
4278-4319: Model selector UX for Claude/Cursor is clear; minor nits onlyThe shared “Select Model” block and per‑provider
<select>s look good, and the readiness copy correctly mapsclaudeModel === 'opus'/'sonnet'to “Opus 4.5” / “Sonnet 4” while usingcursorModelverbatim for Cursor.Two optional polish points:
- The label text for Cursor uses
"Sonnet-4"while the Claude readiness text says"Sonnet 4"– you might standardize the naming for consistency.disabled={provider !== 'cursor'}on the Cursor<select>is redundant inside theprovider === 'claude' ? … : …conditional but harmless.No functional issues here.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.json(1 hunks)src/components/ChatInterface.jsx(5 hunks)
🔇 Additional comments (2)
package.json (1)
43-43: Dependency bump for@anthropic-ai/claude-agent-sdk– confirm compatibilityUpdating to
^0.1.60looks straightforward; just make sure the backend/CLI pieces that consumemodelandimagesoptions are compatible with this version and run the usual test suite afternpm install.src/components/ChatInterface.jsx (1)
3849-3879: Claude submit path now passes images + selected model – aligns with new selectorIncluding both
images: uploadedImagesandmodel: claudeModelin theclaude-commandoptions keeps the backend in sync with the new UI state and uploaded attachments. The dependency list forhandleSubmitalready includesclaudeModel, so this will update correctly when the user changes models.Please just confirm the backend handler for
claude-commandexpectsoptions.modelto be the short key ('opus' | 'sonnet') andoptions.imagesin this shape, or perform any necessary mapping server-side.
Summary
Test plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.