GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — agent: shell deny on a child agent breaks model calls with free-tier auth error · Issue #53908 · anomalyco/opencode

agent: shell deny on a child agent breaks model calls with free-tier auth error #53908

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
agent: shell deny on a child agent breaks model calls with free-tier auth error#53908
Copy link
Assignees
neriousy
Labels
pending closetriaging

Description

@MohamedElseify
MohamedElseify
opened on Oct 8, 2026
Issue body actions

Summary

A custom subagent whose permissions deny shell fails every model call with an authentication error about the free tier, instead of running with shell commands simply unavailable. The identical agent with edit denied instead of shell works fine — so the deny rule itself appears to break the auth path.

Environment

  • opencode version: v2.0.24
  • OS: Linux 7.0.0-38-generic (linux x86_64)
  • Terminal: ghostty (TERM=xterm-256color, TERM_PROGRAM=ghostty, COLORTERM=truecolor)
  • Shell: /bin/bash
  • Install/channel: latest release
  • Active plugins: custom-tools (repo-local .opencode/plugins/custom-tools.ts)

Reproduction

  1. Create ~/.config/opencode/agents/probe-shell-deny.md:

    ---
    description: "Probe agent - shell deny only"
    mode: subagent
    permissions:
      - action: shell
        resource: "*"
        effect: deny
    ---
    
    Reply with exactly: PROBE-SHELL-DENY-OK
  2. From any parent agent, launch it as a subagent (e.g. from build): "Launch the probe-shell-deny subagent and report its verbatim reply".

  3. The child session is created successfully; the model call inside it fails.

Expected Behavior

The child session runs and replies; actual shell commands are denied when it attempts them.

Actual Behavior

Every model call in the child fails:

AI.Error.Authentication: OpenCode's free tier can only be used from within OpenCode

Server log:

level=ERROR message="Failed to drain Session"
cause="AI.Error: OpenCode's free tier can only be used from within OpenCode ...
  [cause]: AI.Error.Authentication: OpenCode's free tier can only be used from within OpenCode"
role=server sessionID=<child-session-id>

Additional Context

  • Controls from the same parent session, same model (opencode/big-pickle on every child session record):
    • shell deny → fails (4/4 across two agents)
    • edit deny only → works
    • no permissions block → works
    • builtin explore → works
  • The child session is always created; failure happens at the first model step, which suggests the free-tier auth path exercises an internal shell/tool operation that the child's deny rule silently blocks, surfacing as an auth error rather than a permission error.
  • Consistent, not intermittent.
  • Workaround: deny edit only (docs say edit covers edit/write/patch tools) and enforce "no shell commands" via the system prompt.

Activity

  1. github-actions
    assigned
    neriousy
    on Oct 8, 2026
  2. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 8, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the careful control experiments! I think this is a duplicate of #50627. It's the same shell deny rule on a custom agent causing the same free-tier error on v2, and changing the rule to ask or allow makes it work. People there narrowed it down: the free-tier check rejects requests whose tool list doesn't include the shell tool, and a deny rule removes that tool from the list. That would explain why edit deny works and shell deny doesn't.

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

    • policy: deny shell * on custom agent breaks free tier with "can only be used from within OpenCode" #50627: same trigger (shell deny on a custom agent) and the same free-tier error on v2, with the root-cause analysis
    • agents: config-defined shell deny on free-model agent fails session with misleading free-tier error #51193: same thing on v2.0.16, also a custom agent spawned as a subagent with edit + shell deny
    • subagent: Bash-less agent profiles fail at launch with free-tier error #52880: subagents without shell access fail at launch with the same error
    • subagent: custom agent spawn fails with "free tier can only be used from within OpenCode" #50806: a custom subagent fails to spawn with the same error
    • tools.read = false in opencode.json makes all zen free-tier models fail with "free tier can only be used from within OpenCode" #51315: turning off a different tool (tools.read = false) causes the same free-tier failure

    Until it's fixed, a workaround reported in #50627 is to set shell to ask instead of deny. The tool then stays in the tool list and each command still needs approval.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  3. opencode-agent
    added
    pending close
    triaging
    on Oct 8, 2026
  4. MohamedElseify commented on Oct 8, 2026

    @MohamedElseify
    MohamedElseify
    on Oct 8, 2026
    Author
    More actions

    Confirmed — this is a duplicate of #50627, thank you for the root-cause pointer.

    Our control matrix on v2.0.24 corroborates the tool-list explanation exactly:

    • shell deny → 4/4 auth failures (two different custom agents)
    • edit deny only → works
    • no permissions block → works
    • builtin explore → works

    All children on the same model, same parent session, and it reproduced after a service restart. One small additional data point: it also happens with mode: all agents spawned as subagents, not only mode: subagent.

    We've adopted the ask workaround from #50627 on our read-only agents and can confirm it holds on v2.0.24: with shell: effect: ask the child launches and replies normally, while every command still needs approval. Agreeing to close as duplicate.

  5. opencode-agent
    closed this as duplicateon Oct 9, 2026
  6. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 9, 2026 – with OpenCode Agent
    Contributor
    More actions

    Closing this as a duplicate of #50627. We waited a day for a reply explaining how this differs, and there wasn't one. #50627 reports the same problem on v2: a shell deny rule on a custom agent makes free-tier model calls fail with "OpenCode's free tier can only be used from within OpenCode". Please follow that issue for updates, and add your v2.0.24 subagent results there if they help. Until it's fixed, the workaround reported there is to set shell to ask instead of deny. If your problem turns out to be different, reply here and we can reopen.

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

Metadata

Metadata

Assignees

  • @neriousy
    neriousy

Labels

pending closetriaging

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.