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
OpenCode does not recognize the model assigned to the subagent. #25802
When attempting to configure a custom subagent to use OpenRouter models via the model: openrouter/ format in the agent configuration file (.opencode/agents/subagent.md), OpenCode consistently throws a ProviderModelNotFoundError, even when using model IDs that appear in the opencode models list.
Steps to reproduce:
Create or edit a subagent configuration file (e.g., .opencode/agents/subagent1.md)
Add a model configuration using OpenRouter format: model: openrouter/nvidia/nemotron-3-super-120b-a12b (or any other)
Ensure the model ID exists in opencode models output under the openrouter/ section
Attempt to invoke the subagent via @subagent1 or Task tool delegation
Observe ProviderModelNotFoundError despite valid model configuration
Expected behavior:
The subagent should initialize and process tasks using the specified OpenRouter model.
Actual behavior:
Persistent ProviderModelNotFoundError occurs regardless of the specific OpenRouter model ID used (tested with multiple models from the opencode models list).
Environment:
Operating System: Windows
OpenCode version: 1.2.27
Configuration: Custom subagent in .opencode/agents/ directory
Additional notes:
The issue appears specific to subagent model configuration, as primary agents and built-in subagents (like explore) function correctly with OpenRouter models. The error persists even when using model IDs verbatim from opencode models output, suggesting a potential issue in how subagents resolve or validate OpenRouter model configurations.
Activity
github-actions commentedon May 5, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is the same as one of the above, please close this one and add any additional context there.
rekram1-node commentedon May 5, 2026
need more info not following
im-id01 commentedon May 7, 2026
Well I have the same issue.
When attempting to configure a custom subagent to use OpenRouter models via the model: openrouter/ format in the agent configuration file (.opencode/agents/subagent.md), OpenCode consistently throws a ProviderModelNotFoundError, even when using model IDs that appear in the opencode models list.
Steps to reproduce:
Expected behavior:
The subagent should initialize and process tasks using the specified OpenRouter model.
Actual behavior:
Persistent ProviderModelNotFoundError occurs regardless of the specific OpenRouter model ID used (tested with multiple models from the opencode models list).
Environment:
Additional notes:
The issue appears specific to subagent model configuration, as primary agents and built-in subagents (like explore) function correctly with OpenRouter models. The error persists even when using model IDs verbatim from opencode models output, suggesting a potential issue in how subagents resolve or validate OpenRouter model configurations.
rekram1-node commentedon May 7, 2026
I tested this:
cannot reproduce
mppks commentedon May 9, 2026
I'm getting the same error when defining a subagent in the MD file. When defining a subagent with the same data in JSON, everything works fine.
rekram1-node commentedon May 11, 2026
How are u defining it in markdown tho? maybe make sure the model name is properly quoted
im-id01 commentedon May 11, 2026
ok, it seems it worked now, i think i had to restart opencode ... then it started to work
rekram1-node commentedon May 26, 2026
cant reproduce this, i think it may be from ur plugin, try w/
opencode --pure