GeezerVison is showing github.com — [Bug] "OpenCode's free tier can only be used from within OpenCode" error when using Custom Agents · Issue #50081 · anomalyco/opencode
[Bug] "OpenCode's free tier can only be used from within OpenCode" error when using Custom Agents #50081DescriptionDescription
Describe the bug
I am encountering an error when attempting to use a custom agent configuration within OpenCode. The request fails, and the console outputs the following error message:
Error from provider (Console): OpenCode's free tier can only be used from within OpenCode
To Reproduce
Configure a custom agent (e.g., modifying the configuration to use a specific model or custom prompt).
Trigger the agent within the OpenCode environment.
Observe the error in the console output.
Expected behavior
The custom agent should execute normally using the available free tier, as it is being invoked from within the OpenCode application.
Actual behavior
The provider rejects the request, stating that the free tier can only be used "within OpenCode," despite the request originating from the OpenCode client.
Additional Context
It appears the provider's validation logic might be incorrectly identifying the custom agent request as an external or unauthorized source.
Attached is a screenshot of the specific error message.
Plugins
No response
OpenCode version
1.18.31
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response Activityzzjcnn commented on Sep 20, 2026 Neloy-Barman commented on Sep 20, 2026 I ran into this same issue yesterday while trying to run a custom agent. After digging around, it looks like this is a known side effect of OpenCode's V1 → V2 migration — agent configs defined the old way won't work under V2 without updating the permission format.
For reference, here's a simple code reviewer agent definition:
V1 (old) permission format:
---
description: Primary review agent that validates implementation quality and creates comprehensive test scenarios
mode: primary
model: opencode/mimo-v2.5-free
temperature: 0.1
permission:
read: allow
edit: deny
bash: deny
---
You are the Primary Review Agent responsible for validating implementation quality and creating comprehensive test scenarios.
V2 (new) permission format:
---
description: Primary review agent that validates implementation quality and creates comprehensive test scenarios
mode: primary
model: opencode/mimo-v2.5-free
permissions:
- action: read
resource: "*"
effect: allow
- action: edit
resource: "*"
effect: deny
- action: bash
resource: "*"
effect: deny
---
You are the Primary Review Agent responsible for validating implementation quality and creating comprehensive test scenarios.
Switching to the V2 permission block (array of {action, resource, effect} objects instead of the flat permission map) fixed it for me. This isn't a bug on OpenCode's end — it's purely a migration issue on the agent config side.
Docs: https://opencode.ai/v2/docs/migrate-v1/#permissions-and-tools Reacted by Drasenix Reacted by Sekedus qstmenu commented on Sep 20, 2026 Got the same issue when running the "opencode agent create" command to make custom agent.
 Neloy-Barman commented on Sep 20, 2026 @qstmenu, try creating the agent config manually instead of using CMD. Drasenix commented on Sep 21, 2026 Neloy-Barman commented on Sep 21, 2026 marco-rionaut commented on Sep 22, 2026 Reproduces on 2.0.12 (macOS, Homebrew) — and the trigger narrows down to the agent's deny permissions, not the permission format. The V2 permissions array does not fix it here:
| agent |
permissions |
result |
f4noperm |
none |
bereit (works) |
f4deny |
V2 array: edit+shell → deny |
403 |
f4denyv1 |
V1 map: edit: deny, bash: deny |
403 |
Minimal repro:
.opencode/agent/deny.md
---
description: repro
mode: primary
permissions:
- {"action": "edit", "resource": "*", "effect": "deny"}
- {"action": "shell", "resource": "*", "effect": "deny"}
---
printf 'Reply with one word: ok' | opencode run --standalone --model opencode/muse-spark-1.3-contributor-free --format json --agent deny
- →
{"type":"error","error":{"type":"provider.auth","message":"Error from provider (Console): OpenCode's free tier can only be used from within OpenCode","status":403}}
The same invocation with --agent build (or an agent without denies) answers normally; --standalone makes no difference.
Environment: opencode v2.0.12 (Homebrew opencode-v2), macOS 27.0 arm64. Suspect: with tools stripped by deny, the request no longer passes the console-side origin check. sekedus commented on Sep 22, 2026 thdxr commented on Oct 11, 2026 Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
SC0d3r commented on Oct 17, 2026
I am constantly getting this error in opencode version v2.0.32
and i am not using any agent, its just a simple default build mode in opencode v2 sixfingerdev commented on Oct 18, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|