You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom subagents with explicit model config throw ProviderModelNotFoundError #5623
When a primary agent invokes a custom subagent (defined in opencode.json) via the Task tool, the subagent fails with ProviderModelNotFoundError even though:
The model is explicitly configured for that subagent
The model is available and works when selected directly via /models
Configure a primary agent with explicit model (ex: claude-sonnet-4.5)
Configure a subagent with explicit model (ex: claude-opus-4.5)
Start a session with the primary agent
Primary agent invokes Task tool with subagent_type: "agentB"
Expected behavior:
AgentB subagent should start using claude-opus-4.5 as configured in opencode.json
Actual behavior:
ProviderModelNotFoundError: ProviderModelNotFoundError
Additional context:
The model claude-opus-4.5 IS available and works when selected directly via /models
Using subagent_type: "general" works correctly
Workaround:
Using subagent_type: "general" with detailed prompts that simulate the specialized agent's behavior.
Activity
rekram1-node commentedon Dec 16, 2025
hm okay ill take a look
rekram1-node commentedon Dec 16, 2025
I cannot replicate your issue can you show me output of:
opencode debug configesilverio commentedon Dec 17, 2025
Hi, off course.
{
"$schema": "https://opencode.ai/config.json",
"agent": {
"gohan": {
"model": "github-copilot/claude-sonnet-4.5",
"temperature": 0.2,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"task": true
},
"description": "...",
"mode": "all",
"maxSteps": 15,
"permission": {
"edit": "allow",
"bash": "allow",
"webfetch": "allow"
}
},
"takeshi": {
"model": "github-copilot/claude-opus-4.5",
"temperature": 0.1,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"webfetch": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 20,
"permission": {
"edit": "allow",
"bash": "allow",
"webfetch": "allow"
}
},
"yuki": {
"model": "github-copilot/claude-sonnet-4.5",
"temperature": 0.2,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 15,
"permission": {
"edit": "allow",
"bash": "allow",
"webfetch": "allow"
}
},
"sakura": {
"model": "github-copilot/gpt-5.1-codex",
"temperature": 0.3,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"glob": true,
"grep": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 30,
"permission": {
"edit": "allow",
"bash": "allow",
"webfetch": "allow"
}
},
"hiroshi": {
"model": "github-copilot/claude-opus-4.5",
"temperature": 0.1,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"grep": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 20,
"permission": {
"edit": "allow",
"bash": {
"git ": "allow",
"": "ask"
},
"webfetch": "allow"
}
},
"kaito": {
"model": "github-copilot/claude-sonnet-4.5",
"temperature": 0.1,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"grep": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 20,
"permission": {
"edit": "allow",
"bash": {
"npm test*": "allow",
"dotnet test*": "allow",
"mvn test*": "allow",
"*": "ask"
},
"webfetch": "allow"
}
},
"kenji": {
"model": "github-copilot/claude-haiku-4.5",
"temperature": 0.2,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 15,
"permission": {
"edit": "allow",
"bash": {
"git ": "allow",
"": "ask"
},
"webfetch": "allow"
}
},
"akira": {
"model": "github-copilot/claude-opus-4.5",
"temperature": 0.2,
"prompt": "...",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"glob": true,
"grep": true
},
"description": "...",
"mode": "subagent",
"maxSteps": 25,
"permission": {
"edit": "allow",
"bash": {
"git ": "allow",
"": "ask"
},
"webfetch": "allow"
}
}
},
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"enabled": true,
"headers": {
"CONTEXT7_API_KEY": ""
}
}
},
"mode": {},
"plugin": [],
"command": {},
"username": "eduardo.m.silverio",
"keybinds": {
"leader": "ctrl+x",
"app_exit": "ctrl+c,ctrl+d,q",
"editor_open": "e",
"theme_list": "t",
"sidebar_toggle": "b",
"scrollbar_toggle": "none",
"username_toggle": "none",
"status_view": "s",
"session_export": "x",
"session_new": "n",
"session_list": "l",
"session_timeline": "g",
"session_share": "none",
"session_unshare": "none",
"session_interrupt": "escape",
"session_compact": "c",
"messages_page_up": "pageup",
"messages_page_down": "pagedown",
"messages_half_page_up": "ctrl+alt+u",
"messages_half_page_down": "ctrl+alt+d",
"messages_first": "ctrl+g,home",
"messages_last": "ctrl+alt+g,end",
"messages_last_user": "none",
"messages_copy": "y",
"messages_undo": "u",
"messages_redo": "r",
"messages_toggle_conceal": "h",
"tool_details": "none",
"model_list": "m",
"model_cycle_recent": "f2",
"model_cycle_recent_reverse": "shift+f2",
"model_cycle_favorite": "none",
"model_cycle_favorite_reverse": "none",
"command_list": "ctrl+p",
"agent_list": "a",
"agent_cycle": "tab",
"agent_cycle_reverse": "shift+tab",
"input_clear": "ctrl+c",
"input_paste": "ctrl+v",
"input_submit": "return",
"input_newline": "shift+return,ctrl+return,alt+return,ctrl+j",
"input_move_left": "left,ctrl+b",
"input_move_right": "right,ctrl+f",
"input_move_up": "up",
"input_move_down": "down",
"input_select_left": "shift+left",
"input_select_right": "shift+right",
"input_select_up": "shift+up",
"input_select_down": "shift+down",
"input_line_home": "ctrl+a",
"input_line_end": "ctrl+e",
"input_select_line_home": "ctrl+shift+a",
"input_select_line_end": "ctrl+shift+e",
"input_visual_line_home": "alt+a",
"input_visual_line_end": "alt+e",
"input_select_visual_line_home": "alt+shift+a",
"input_select_visual_line_end": "alt+shift+e",
"input_buffer_home": "home",
"input_buffer_end": "end",
"input_select_buffer_home": "shift+home",
"input_select_buffer_end": "shift+end",
"input_delete_line": "ctrl+shift+d",
"input_delete_to_line_end": "ctrl+k",
"input_delete_to_line_start": "ctrl+u",
"input_backspace": "backspace,shift+backspace",
"input_delete": "ctrl+d,delete,shift+delete",
"input_undo": "ctrl+-,super+z",
"input_redo": "ctrl+.,super+shift+z",
"input_word_forward": "alt+f,alt+right,ctrl+right",
"input_word_backward": "alt+b,alt+left,ctrl+left",
"input_select_word_forward": "alt+shift+f,alt+shift+right",
"input_select_word_backward": "alt+shift+b,alt+shift+left",
"input_delete_word_forward": "alt+d,alt+delete,ctrl+delete",
"input_delete_word_backward": "ctrl+w,ctrl+backspace,alt+backspace",
"history_previous": "up",
"history_next": "down",
"session_child_cycle": "right",
"session_child_cycle_reverse": "left",
"terminal_suspend": "ctrl+z"
}
}
gliatti commentedon Dec 20, 2025
I'm experiencing a similar issue with custom agents defined via markdown files in
~/.config/opencode/agent/.When specifying a
model:field in the YAML frontmatter, opencode adds a trailing/to the model name, causing validation to fail.Example agent configuration:
Error message:
Note the trailing
/added to the model name (qwencoder14b:latest/).Workaround: Removing the
model:field from the agent definition allows the agent to use the default model successfully.Environment:
rekram1-node commentedon Dec 20, 2025
@robinportigliatti your model does not appear to be valid it always needs to be in format:
provider/model
so either your provider prefix is missing or you arent using correct separator
to see valid model ids just run:
opencode models
diegonix commentedon Jan 20, 2026
opencode is adding
\nin the end of the model line:opencode debug config ... "my-agent": { "model": "synthetic/hf:zai-org/GLM-4.7\n", ...agent config file:
mdc-git commentedon Jan 23, 2026
Same issue, I tried
hf:zai-org/GLM-4.7andsynthetic/GLM-4.7as well.EDIT: Nevermind. Putting quotation marks around the model name seems to fix this. Wasn't needed for opencode provider though.
works for me.