-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug Description
The agents.sisyphus-junior.model configuration in oh-my-opencode.json is completely ignored. Despite the schema correctly defining sisyphus-junior as a configurable agent, and the code appearing to read the configuration, the actual model used at runtime does not respect the user's configuration.
Analysis using oh-my-opencode codebase:
After analyzing the source code, I found the root cause:
- Schema layer ✅ -
sisyphus-junioris correctly defined inAgentOverridesSchema - Agent registration ✅ -
createSisyphusJuniorAgentWithOverrides()reads the config correctly - Runtime invocation ❌ - When called via
delegate_task(category="xxx"), the model resolution logic bypasses the agent config
The problem is in delegate-task/tools.ts:
if (args.category) {
const resolution = resolveModelWithFallback({
userModel: userCategories?.[args.category]?.model, // Priority 1: category model
categoryDefaultModel: resolved.model ?? sisyphusJuniorModel, // Priority 3: sisyphusJuniorModel is just fallback!
fallbackChain: requirement.fallbackChain, // Priority 2: hardcoded fallbackChain
availableModels,
systemDefaultModel,
})
agentToUse = SISYPHUS_JUNIOR_AGENT // Uses sisyphus-junior agent
categoryModel = ... // But model comes from category resolution, not agent config!
}Model resolution priority (current - problematic):
userCategories?.[category]?.model- category's model configrequirement.fallbackChain- hardcoded fallback chainsisyphusJuniorModel- user'sagents.sisyphus-junior.modelconfig (lowest priority!)systemDefaultModel
This means agents.sisyphus-junior.model is effectively useless because it has the lowest priority.
Related issues:
- [Bug]: Sisyphus-Junior agent ignores config and uses Anthropic provider instead of configured Google model #766 (CLOSED but not fixed) - Sisyphus-Junior ignores config and uses Anthropic provider
- [Bug]: Unable to override model via config for Sisyphus-Junior background task #826 (CLOSED but not fixed) - Unable to override model via config for Sisyphus-Junior background task
- [Bug]: delegate_task with category parameter fails with "JSON Parse error: Unexpected EOF" - categories config ignored #1264 (OPEN) - Reports that
categories.*.modelis ALSO ignored due touiSelectedModeloverriding everything
Important finding from #1264:
Issue #1264 reveals that even configuring categories.*.model doesn't work because uiSelectedModel (main session model) has the HIGHEST priority and overrides ALL agent/category model configurations.
This means both workarounds are blocked:
- ❌
agents.sisyphus-junior.model→ bypassed by category resolution - ❌
categories.*.model→ overridden byuiSelectedModel
Steps to Reproduce
- Configure
oh-my-opencode.json:
{
"agents": {
"sisyphus-junior": {
"model": "anthropic/claude-sonnet-4-5"
}
}
}-
Start OpenCode with a different main model (e.g.,
claude-opus-4-5) -
Trigger a category-based delegation:
delegate_task(category="quick", load_skills=[], prompt="...", run_in_background=false)
- Observe that
sisyphus-juniordoes NOT useanthropic/claude-sonnet-4-5
Expected Behavior
When agents.sisyphus-junior.model is configured, the Sisyphus-Junior agent should use that model regardless of:
- Which category is used to spawn it
- What the main session's model is
User-defined agent model configuration should have the HIGHEST priority.
Actual Behavior
The agents.sisyphus-junior.model configuration is ignored. The model is determined by:
- Main session's model (
uiSelectedModel) - if [Bug]: delegate_task with category parameter fails with "JSON Parse error: Unexpected EOF" - categories config ignored #1264's analysis is correct - Category's fallback chain
- Category's default model
User's explicit agent configuration is never applied.
Doctor Output
# bunx oh-my-opencode doctor failed with workspace dependency error
# OpenCode version: 1.1.45
# oh-my-opencode version: latest (3.1.9)Error Logs
No explicit error - the configuration is silently ignored.Configuration
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
"agents": {
"sisyphus-junior": {
"model": "anthropic/claude-sonnet-4-5"
}
}
}Additional Context
Summary of related issues:
| Issue | Status | Problem | Fixed? |
|---|---|---|---|
| #766 | CLOSED | Sisyphus-Junior ignores config, uses Anthropic | ❌ Comments say bug persists |
| #826 | CLOSED | Cannot override model for background tasks | ❌ Comments say bug persists in beta 11 |
| #1264 | OPEN | uiSelectedModel overrides ALL agent configs |
❌ |
Root cause analysis from #766 comments (by @kassieclaire):
"override configuration from oh-my-opencode.json is being passed through the direct agent override path (via
createSisyphusJuniorAgentWithOverrides) rather than through the category-based path"
Suggested fix:
In resolveModelWithFallback(), the priority should be:
// 1. User's explicit agent config (HIGHEST)
if (normalizedUserModel) {
return { model: normalizedUserModel, source: "override" };
}
// 2. Category config
// 3. Fallback chain
// 4. System default (LOWEST)Or better: remove uiSelectedModel from subagent model resolution entirely - it should only apply to the main session.
Operating System
Windows
OpenCode Version
1.1.45