anomalyco / anomalyco/opencode

[Bug] "OpenCode's free tier can only be used from within OpenCode" error when using Custom Agents

Open
#50,081 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the custom-agent request described for OpenCode 1.18.31 and trace the provider request and its free-tier validation. Compare a custom-agent invocation with a normal OpenCode request; done means the custom agent executes without the provider rejecting it as external.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.