Skip to content

subagent: free-tier restriction triggers incorrectly when spawning from within OpenCode #55569

Closed as duplicate

Description

@CodeMaster013

Summary

Subagent spawn fails with "OpenCode's free tier can only be used from within OpenCode" error even when already running inside OpenCode v2.0.28. An agent configured to use the opencode provider with free-tier model muse-spark-1.3-contributor-free cannot be spawned.

Environment

  • opencode version: 2.0.28
  • OS: Linux 7.2.9-arch1-1 (linux x64)
  • Terminal: TERM=xterm-kitty, COLORTERM=truecolor
  • Shell: /usr/bin/zsh
  • Install/channel: latest
  • Active plugins: envsitter-guard, opencode-mem, custom plugin (local path)

Reproduction

  1. Configure an agent (e.g., fixer) in OpenCode config to use the opencode provider with a free-tier model (e.g., muse-spark-1.3-contributor-free)
  2. Start OpenCode (TUI or CLI)
  3. Attempt to spawn the configured agent via the agent spawn UI or programmatically
  4. Observe the error: "OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."

Expected Behavior

The subagent should spawn successfully since we are already running inside OpenCode. The free-tier restriction should only apply when trying to use OpenCode models from outside the OpenCode environment.

Actual Behavior

Subagent spawn fails immediately with the free-tier restriction error, even though the parent session is running inside OpenCode v2.0.28.

Additional Context

  • The issue affects any agent configured with the opencode provider and a free-tier model
  • Reproduced consistently (100% failure rate on spawn attempts)
  • Agent config maps the fixer agent to: "provider": "opencode", "model": "muse-spark-1.3-contributor-free"
  • Other agents using the nvidia provider work correctly
  • This appears to be a false positive in the free-tier enforcement logic - it's not detecting that the request originates from within an OpenCode session

Activity

  1. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Thanks for the report! I think this is a duplicate of #50806: a custom subagent on a free OpenCode Zen model fails to spawn with this exact error, while the parent session works.

    The cause is tracked in #50627. People there found that the free-tier check on the Console side rejects requests whose tool list leaves out some of the standard tools. This usually happens because the agent's permissions fully deny shell/bash (e.g. bash: deny or a shell * deny rule). Denying other tools such as read, or allowing only a small set of tools, can trigger it too. Built-in agents with the full toolset are not affected, which matches what you're seeing with fixer.

    Workaround until it's fixed: check your fixer agent's permissions. If it denies bash/shell (or removes other tools), change deny to ask and try again.

    Possible duplicates and closely related issues, ordered from most to least likely:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different, for example if your fixer agent doesn't deny or remove any tools. If the workaround helps, or if you have new findings, please add them to #50627.

  2. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #50806, since we haven't heard back that your case is different. The root cause is tracked in #50627: the free-tier check rejects requests whose tool list leaves out standard tools, usually because a custom agent denies bash/shell.

    Until it's fixed, check your fixer agent's permissions and change any bash/shell deny to ask. Please follow #50627 for updates and add any new findings there. If your fixer agent doesn't deny or remove any tools, reply here and we can take another look. Thanks for reporting!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions