-
Notifications
You must be signed in to change notification settings - Fork 519
fix: Correct OpenCode dynamic models API endpoint URL #715
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
fix: Correct OpenCode dynamic models API endpoint URL #715
Conversation
The fetchOpencodeModels function was calling '/api/opencode/models' which returns 404. Changed to '/api/setup/opencode/models' which correctly returns the dynamic models. This fixes an issue where enabled OpenCode dynamic models (e.g., local Ollama models) were not appearing in the Model Defaults dropdown selectors despite being visible and enabled in the OpenCode Settings page.
Summary of ChangesHello @OG-Ken, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented OpenCode dynamic models from being displayed in the Model Defaults dropdown selectors. The fix involves updating an incorrect API endpoint URL within the application's store, ensuring that the UI correctly fetches and presents these models to the user, thereby improving the model selection experience. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📝 WalkthroughWalkthroughThe OpenCode models API endpoint in the application store is updated from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Code Review
The pull request correctly identifies and fixes the API endpoint for fetching OpenCode dynamic models. The change from /api/opencode/models to /api/setup/opencode/models aligns with the server-side route definitions, resolving the issue where dynamic models were not appearing in the UI. The testing steps confirm the fix's effectiveness. This is a straightforward and necessary correction.
Summary
This PR fixes a bug where enabled OpenCode dynamic models (e.g., local Ollama models) were not appearing in the Model Defaults dropdown selectors.
Root Cause
The fetchOpencodeModels function in apps/ui/src/store/app-store.ts was calling the wrong API endpoint:
/api/opencode/models→ Returns 404/api/setup/opencode/models→ Returns 200 with dynamic modelsThe OpenCode Settings page worked correctly because it uses React Query hooks that call the correct endpoint, but the app store's fetchOpencodeModels function was calling a non-existent endpoint.
Changes
/api/opencode/modelsto/api/setup/opencode/modelsin the fetchOpencodeModels function (line 2515)Testing
GET /api/setup/opencode/models 200instead ofGET /api/opencode/models 404Checklist
v0.14.0rc)Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.