-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Prerequisites
- I will write this issue in English (see our Language Policy)
- I have searched existing issues to avoid duplicates
- I am using the latest version of oh-my-opencode
- I have read the documentation or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
Bug Description
I am trying to configure a custom model for a specific subagent/category via oh-my-opencode.json, but the configuration is ignored when the model name does not appear in the hardcoded official model list.
Steps to Reproduce
configured the writing category to use a custom model from a custom provider:
"writing": {
"model": "new-api-openai/gpt-5.4-high"
}Expected Behavior
When a user explicitly specifies a model for a subagent/category in oh-my-opencode.json, that configuration should take precedence over any hardcoded default logic. The system should:
- First check if the user has explicitly configured a model for this subagent
- If yes, use that model (after validating it exists in the provider list)
- Only fall back to hardcoded defaults when no explicit user configuration exists
Actual Behavior
The model matching logic appears to work as follows:
- First, it extracts the model name (e.g.,
gpt-5.4) - Then it checks if this name exists in a hardcoded official model list
- If the name matches an official model, it uses that model
- If the name does NOT match (e.g., customed
gpt-5.4-highor any custom-named model from a custom provider), the entire configuration entry is ignored - The system then falls back to a default model that I never configured, bypassing my explicit setting(e.g., category
writingleads to claude-sonnet-4-6),then subagent faild.
Doctor Output
1. Model override uses unavailable provider
Provider(s) not found in OpenCode model cache: new-api-openai, bailian-coding-plan
Affects: model resolutionError Logs
Configuration
Additional Context
Impact:
This makes it impossible to use custom-named models from custom providers for specific subagents, even when those models are correctly defined in opencode.json. Users who use third-party API proxies or custom model aliases cannot reliably control which model each subagent uses.
Suggested fix:
Change the model resolution priority to:
- User's explicit per-subagent configuration in
oh-my-opencode.json(highest priority) - Hardcoded official model list (lower priority)
- Global default (lowest priority)
Alternatively, at minimum, when a user-configured model name does not match the official list, the system should:
- Log a warning instead of silently ignoring
- Still attempt to use the configured model if it exists in the provider definitions
Operating System
Windows
OpenCode Version
1.2.27