Skip to content

Bug: opencode/xxxxx-model fails when used by a custom subagent #51612

Closed as duplicate

Description

@AB6162

Description

OpenCode free-tier models fail when used by a custom subagent, even though the subagent is executed from within an OpenCode session.

When the custom subagent verifier-dti uses opencode/space-bunny-free, the provider rejects the request with:

Error: Error from provider (Console): OpenCode's free tier can only be used from within OpenCode

This causes the subagent to fail before it can perform its task.

Configuration

Relevant opencode.json configuration:

"verifier-dti": {
  "mode": "subagent",
  "model": "opencode/space-bunny-free",
  "color": "#0891b2",
  "prompt": "{file:./.agents/prompts/verify.md}",
  "permission": {
    "read": {
      "*": "allow",
      "*.env": "deny",
      "*.env.*": "deny",
      "*.env.example": "allow",
      "*.pem": "deny",
      "*.key": "deny",
      "*id_rsa*": "deny"
    },
    "edit": "deny",
    "bash": "deny",
    "task": "deny",
    "question": "deny",
    "skill": "deny",
    "websearch": "allow",
    "webfetch": "allow",
    "external_directory": "ask"
  }
}

The relevant settings are:

"mode": "subagent",
"model": "opencode/space-bunny-free"

Environment

  • OpenCode: 2.0.18
  • OS: Windows 11
  • Editor: Visual Studio Code
  • Terminal: VS Code integrated terminal
  • Agent type: subagent
  • Model: opencode/space-bunny-free

OpenCode is launched directly from the VS Code integrated terminal using:

opencode

No direct API request or external client is used.

Steps to reproduce

  1. Open Visual Studio Code on Windows 11.
  2. Open the integrated terminal.
  3. Run:
opencode
  1. Configure a custom subagent with an OpenCode free-tier model:
{
  "agent": {
    "test-free-model": {
      "mode": "subagent",
      "model": "opencode/space-bunny-free",
      "prompt": "Perform a simple verification task."
    }
  }
}
  1. Start an OpenCode session.
  2. Invoke test-free-model.
  3. The provider rejects the model request with:
Error: Error from provider (Console): OpenCode's free tier can only be used from within OpenCode

Expected behavior

Because the subagent is created and executed by OpenCode itself, the request should be recognized as originating from OpenCode and the OpenCode free-tier model should be allowed to run.

Expected execution flow:

OpenCode
  └── custom subagent
        └── opencode/space-bunny-free

Actual behavior

The provider treats the subagent's model request as if it were coming from outside OpenCode and rejects it with the free-tier restriction error.

The failure occurs during model invocation, before the subagent can execute its verification task.

Additional observation

The issue also occurs with other OpenCode free-tier models used through custom subagent agents.

Activity

  1. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    This issue doesn’t fully meet our contributing guidelines.

    What needs to be fixed:

    • Please condense the description: it repeats the same error, expected/actual behavior, reproduction steps, and explanation in several sections. Keep one concise report with a single reproduction and only the relevant configuration and environment details.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • #50806: A custom subagent fails with the same free-tier “only be used from within OpenCode” error.
    • #49723: A subagent is rejected by the free-tier check while running inside OpenCode.
    • #50516: Subagent execution fails with the same free-tier error.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Thanks for updating the issue. It still repeats the same error and explanation across multiple sections, and includes two overlapping reproduction/configuration examples. Please condense it to one reproduction path and keep the relevant configuration and environment details in a single concise report.

  3. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Thanks for updating the issue. It still repeats the same error and explanation across the “Actual behavior,” “Important observation,” and “Additional information” sections, and includes both a full configuration and a second overlapping minimal configuration/reproduction. Please condense it to one clear reproduction, retaining only the relevant configuration and system details.

  4. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    The issue still needs condensing: the same provider error and explanation are repeated across the Description, Actual behavior, Expected behavior, Important observation, and Steps to reproduce sections, and it includes two overlapping configuration examples. Please keep one concise report with a single reproduction path and only the relevant configuration and environment details.

  5. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Thanks for updating the issue. The report now includes a clear description, reproduction steps, and relevant environment details.

  6. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report. We're tracking this same free-tier rejection of subagent requests in #49723, so I'm closing this as a duplicate. Please follow that issue for updates.

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