GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — fix(core): add vpn hint to free tier and rate limit errors by JayadityaGit · Pull Request #56475 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The free-tier error now gets the hint as described, but the rate-limit match is too broad to merge as is.
I checked it by calling toSessionError on the base and on this PR with a free-tier AuthenticationError and with a non-OpenCode RateLimitError. I also ran bun test test/session-error.test.ts (passes) and bun run typecheck in packages/core (clean).
Public API: unchanged. Only the text of SessionError messages changes; no types, events or config keys change.
Concerns:
message.includes("Rate limit exceeded") runs on every provider's errors. A plain Anthropic/OpenRouter/OpenAI 429 such as Rate limit exceeded: … per-minute quota now ends with "If you are using a VPN or proxy, try disconnecting it.", which is misleading there. Please limit the hint to errors from the OpenCode gateway, matching on something structured such as a gateway error code in reason.body, the way tokenSharingMessages does, rather than on English message text. The gateway may also be a better place for this hint, since it owns both messages.Related: #56334, #56398, #56373, #56397, #56425, #56338, #56111, #56431
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| function vpnHint(message: string) { | ||
| if (message.includes("can only be used from within OpenCode") || message.includes("Rate limit exceeded")) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
providerError runs for every provider, so "Rate limit exceeded" also matches ordinary 429s from Anthropic, OpenRouter, OpenAI and others. I checked: Rate limit exceeded: anthropic/claude per-minute quota becomes … per-minute quota. If you are using a VPN or proxy, try disconnecting it. Could this be limited to the OpenCode gateway's errors, e.g. by matching a gateway error code in reason.body like tokenSharingMessages does, instead of English message substrings?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing it out
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I did not know my vpn was the cause, i had to figure it out the cause, so i had added a small hint to the existing erros, so that it will be helpful to the future devs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
this was my userflow, when i was discovering the issue when i turn on my vpn , and i used opencode for the first time it gave this error
i turned off my vpn and it worked fine, and again to test it i turned on my vpn again and now there seems to be new error which says
i turned off my vpn and it works so i made changes according to that. thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add VPN disconnection hint to free-tier and rate limit error messages
There was an error while loading. Please reload this page.