Skip to content

tui: free-tier model rejected for custom primary agent while build works #55266

Closed as duplicate

Description

@Kerrivil

Description

Summary

Sending any prompt (even a trivial "hola") to a custom primary agent selected with Shift+Tab fails with a free-tier error, while the same prompt to the built-in build agent on the same free model works fine.

Environment

  • opencode version: v2.0.28
  • OS: Linux 6.18.54.1-microsoft-standard-WSL2 (linux x64)
  • Terminal: TERM=xterm-256color (no TERM_PROGRAM/COLORTERM)
  • Shell: /bin/bash
  • Install/channel: latest (release)
  • Active plugins: none (no global config, no project config, no local plugins)

Reproduction

  1. Create a project custom agent at .opencode/agents/coordinator.md with mode: primary (definition below).
  2. Open opencode in that project.
  3. Press Shift+Tab and select the coordinator agent.
  4. Type Hola and send.
  5. Repeat steps 3-4 with the built-in build agent.

Expected Behavior

Both agents respond using the configured free model, since neither the agent definition nor the prompt changes the model or the channel.

Actual Behavior

  • build answers normally.
  • coordinator fails every time with: Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.

Additional Context

  • Reproducible consistently, including with prompts that use no tools, reads, or subagents, so agent permissions are ruled out as the cause.
  • The custom agent defines no model:, so it inherits the same session free model as build.
  • Agent definition used (no secrets):
---
description: SDD - coordina el flujo SDD completo con planner, implementer y reviewer, y transmite el contexto entre fases
mode: primary
permissions:
- action: edit
  resource: "*"
  effect: deny
- action: shell
  resource: "*"
  effect: deny
- action: webfetch
  resource: "*"
  effect: deny
- action: websearch
  resource: "*"
  effect: deny
- action: subagent
  resource: "*"
  effect: deny
- action: subagent
  resource: "planner"
  effect: allow
- action: subagent
  resource: "implementer"
  effect: allow
- action: subagent
  resource: "reviewer"
  effect: allow
---
(agent system prompt omitted, unrelated to the error)
  • Hypothesis: opening a session with a custom primary agent loses the "from within OpenCode" client attestation that the free-tier gateway requires, while built-in agents keep it.

Plugins

None (no global config, no project config, no local plugins)

OpenCode version

v2.0.28

Steps to reproduce

  1. Create a project custom agent at .opencode/agents/coordinator.md with mode: primary (definition below).
  2. Open opencode in that project.
  3. Press Shift+Tab and select the coordinator agent.
  4. Type Hola and send.
  5. Repeat steps 3-4 with the built-in build agent.
  • Reproducible consistently, including with prompts that use no tools, reads, or subagents, so agent permissions are ruled out as the cause.
  • The custom agent defines no model:, so it inherits the same session free model as build.
  • Agent definition used (no secrets):
---
description: SDD - coordina el flujo SDD completo con planner, implementer y reviewer, y transmite el contexto entre fases
mode: primary
permissions:
- action: edit
  resource: "*"
  effect: deny
- action: shell
  resource: "*"
  effect: deny
- action: webfetch
  resource: "*"
  effect: deny
- action: websearch
  resource: "*"
  effect: deny
- action: subagent
  resource: "*"
  effect: deny
- action: subagent
  resource: "planner"
  effect: allow
- action: subagent
  resource: "implementer"
  effect: allow
- action: subagent
  resource: "reviewer"
  effect: allow
---
(agent system prompt omitted, unrelated to the error)

Screenshot and/or share link

No response

Operating System

Linux 6.18.54.1-microsoft-standard-WSL2 (linux x64) (WSL under Windows 10 IoT Enterprise LTSC 21H2 19044.7725)

Terminal

Warp

Activity

  1. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for the clear A/B comparison. I think this is a duplicate of #50627.

    Your coordinator agent has a shell / resource: "*" / effect: deny rule. In #50627, a full shell deny on a custom agent causes this exact error on free-tier models, even for prompts that use no tools. A full shell deny leaves bash out of the request's tool list, and the free-tier gateway then rejects the request. That's why build works and coordinator doesn't.

    Until it's fixed, commenters there report that changing that rule's effect from deny to ask avoids the error. Your agent would then ask before running shell commands instead of refusing them.

    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, reply if it still fails after switching the shell rule to ask. You're welcome to add your v2.0.28 confirmation to #50627.

  2. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Closing as a duplicate of #50627. We left this open for a day in case your problem turned out to be different, and haven't heard back.

    Your coordinator agent has a shell / resource: "*" / effect: deny rule. That is the trigger tracked in #50627: free-tier requests from that agent fail with "OpenCode's free tier can only be used from within OpenCode", while build works. Until it's fixed, changing that rule's effect to ask avoids the error.

    Please follow #50627 for updates, and feel free to add your v2.0.28 confirmation there. If it still fails after switching the shell rule to ask, reply here with the details. Thanks for the clear report!

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