fix(prometheus): respect agent model override instead of using global opencode.json model (fixes #2693)#2753
Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom Mar 25, 2026
Conversation
… opencode.json model (fixes code-yeongyu#2693)
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Follows established patterns in the codebase to fix model priority issues and aligns Prometheus agent configuration with other agents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When
opencode.jsonsets a global model to Gemini (e.g.,"model": "google/gemini-3.1-pro-preview") and the user explicitly configuresagents.prometheus.modelto a Claude model inoh-my-opencode.json, Prometheus still uses the Gemini model and its Gemini-specific prompt.Root cause:
buildPrometheusAgentConfig()passesparams.currentModel(the global model) asuiSelectedModelunconditionally. SinceuiSelectedModelis Step 1 (highest priority) inresolveModelPipeline(), it short-circuits before ever reaching Step 2 where the user's Prometheus-specific model override lives.All other agents guard against this:
sisyphus-agent.ts):uiSelectedModel: sisyphusOverride?.model ? undefined : uiSelectedModelatlas-agent.ts):uiSelectedModel: orchestratorOverride?.model ? undefined : uiSelectedModelgeneral-agents.ts):uiSelectedModel: (isPrimaryAgent && !override?.model) ? uiSelectedModel : undefinedPrometheus lacked this guard.
Fix
Applied the same guard pattern used by all other agents:
When the user explicitly configures a Prometheus model (via
agents.prometheus.modelor category config),uiSelectedModelis set toundefined, allowing the user's override to take priority. Additionally,categoryConfig?.modelis now correctly placed incategoryDefaultModelinstead of being folded intouserModel.Changes
src/plugin-handlers/prometheus-agent-config-builder.tsFixes #2693
Summary by cubic
Fix Prometheus to honor its agent-specific model override instead of the global
opencode.jsonmodel, and put the category model in the correct pipeline slot. Fixes #2693.uiSelectedModelwhen a Prometheus-specific or category model is set, so the override wins inresolveModelPipeline().categoryDefaultModelfor the category model instead ofuserModel.Written for commit 11f1d71. Summary will update on new commits.