Skip to content

OpenCode does not recognize the model assigned to the subagent. #25802

Closed as not planned

Description

@marcosneves04

Description

Defining different models for the sub-agent is not being considered, returning “” (empty).

Plugins

None

OpenCode version

1.14.35

Steps to reproduce

Creating a test with a sub-agent associated with a model different from the primary agents.

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

Windows 10 Terminal, called from within VSC.

Activity

  1. github-actions commented on May 5, 2026

    @github-actions
    Contributor

    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.

  2. rekram1-node commented on May 5, 2026

    @rekram1-node
    Contributor

    need more info not following

  3. im-id01 commented on May 7, 2026

    @im-id01

    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:

    1. Create or edit a subagent configuration file (e.g., .opencode/agents/subagent1.md)
    2. Add a model configuration using OpenRouter format: model: openrouter/nvidia/nemotron-3-super-120b-a12b (or any other)
    3. Ensure the model ID exists in opencode models output under the openrouter/ section
    4. Attempt to invoke the subagent via @subagent1 or Task tool delegation
    5. 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.

  4. rekram1-node commented on May 7, 2026

    @rekram1-node
    Contributor

    I tested this:

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {},
      "agent": {
        "custom": {
          "model": "openrouter/nvidia/nemotron-3-super-120b-a12b",
          "mode": "subagent",
        },
      }
    }
    

    cannot reproduce

  5. mppks commented on May 9, 2026

    @mppks

    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.

  6. rekram1-node commented on May 11, 2026

    @rekram1-node
    Contributor

    How are u defining it in markdown tho? maybe make sure the model name is properly quoted

  7. im-id01 commented on May 11, 2026

    @im-id01

    ok, it seems it worked now, i think i had to restart opencode ... then it started to work

  8. rekram1-node commented on May 26, 2026

    @rekram1-node
    Contributor

    cant reproduce this, i think it may be from ur plugin, try w/ opencode --pure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions