Skip to content

Conversation

@OG-Ken
Copy link

@OG-Ken OG-Ken commented Jan 27, 2026

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:

  • Wrong: /api/opencode/models → Returns 404
  • Correct: /api/setup/opencode/models → Returns 200 with dynamic models

The 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

  • Changed API endpoint URL from /api/opencode/models to /api/setup/opencode/models in the fetchOpencodeModels function (line 2515)

Testing

  • Verified dynamic models (Ollama local models) now appear in Model Defaults dropdown after enabling them in OpenCode Settings
  • Server logs now show GET /api/setup/opencode/models 200 instead of GET /api/opencode/models 404

Checklist

  • Targets the current RC branch (v0.14.0rc)
  • Clear title describing the change
  • All CI checks should pass (single line change, no breaking changes)
  • No merge conflicts

Summary by CodeRabbit

  • Chores
    • Updated internal API endpoint for model configuration retrieval.

✏️ Tip: You can customize this high-level summary in your review settings.

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.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • API Endpoint Correction: The API endpoint for fetching OpenCode dynamic models was corrected from '/api/opencode/models' to '/api/setup/opencode/models' within the 'fetchOpencodeModels' function. This resolves a bug where dynamic models were not appearing in the Model Defaults dropdown selectors.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

The OpenCode models API endpoint in the application store is updated from /api/opencode/models to /api/setup/opencode/models. All existing logic for model filtering, data updates, and error handling remains unchanged.

Changes

Cohort / File(s) Summary
API Endpoint Update
apps/ui/src/store/app-store.ts
Updated OpenCode models fetch endpoint from /api/opencode/models to /api/setup/opencode/models

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop down the path to /setup/opencode/,
Where models now gather with endpoints aglow,
One line changed, one route refreshed,
The burrow's APIs are perfectly meshed! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: correcting the OpenCode dynamic models API endpoint URL from an incorrect path to the correct one.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@Shironex Shironex added the Bug Something isn't working label Jan 27, 2026
@Shironex Shironex merged commit ef3f8de into AutoMaker-Org:v0.14.0rc Jan 27, 2026
6 of 7 checks passed
@OG-Ken OG-Ken deleted the fix/opencode-dynamic-models-404-endpoint branch January 27, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants