fix(console): distinct error message for blocked workspaces - #40944
Open
Sanjay-doppalapudi wants to merge 1 commit into
Open
fix(console): distinct error message for blocked workspaces#40944Sanjay-doppalapudi wants to merge 1 commit into
Sanjay-doppalapudi wants to merge 1 commit into
Conversation
A workspace with is_blocked set gets the same error as the vendor-flag paths: "Request blocked by upstream provider." For is_blocked no upstream provider was involved - the request is refused before any relay - so the message points users at the wrong party. They rotate keys, check billing, and file duplicate issues instead of contacting support. Split the is_blocked branch onto its own i18n key that says what actually happened and where to go. The vendor-flag branches keep the upstream wording, which is accurate there. Same AuthError, same 401, enforcement unchanged - only the message differs. Locale files spread ...en before their overrides, so the new key falls back to English everywhere without touching the other 17 dictionaries.
This was referenced Aug 6, 2026
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #38218
Same error reported in #38195, #38216, #38257, #38323, #38473, #39215, #39827, #40055. Root-cause analysis: #38218 (comment)
Type of change
What does this PR do?
authenticate()inpackages/console/app/src/routes/zen/util/handler.tsthrows the same message for three different workspace flags:For the two vendor flags the wording is accurate. For
is_blockedit is not: the request is rejected before any relay and no upstream provider is involved. Users then debug the wrong things (rotate keys, clear auth caches, check vendor status) and file duplicate issues — the 9 linked above all show the error onminimax-*,kimi-*,glm-*,deepseek-*or*-freeids, which the vendor flags cannot match, so every one of them is theis_blockedbranch.The fix gives
is_blockedits own branch and message:with
"zen.api.error.workspaceBlocked": "This workspace has been blocked. Contact support: https://opencode.ai/discord"added toen.ts.Enforcement is unchanged: a blocked workspace is refused at the same point, with the same
AuthErrorclass and the same 401. Only the message differs. Locale dicts spread...enbefore their overrides, so the new key falls back to English in all locales without touching the other dictionaries (happy to add translations if wanted).How did you verify your code works?
en.tsandzh.tswith bun: all 730 keys load, the new key resolves, andzhfalls back to the English string through the spread.POST /zen/v1/chat/completionsreturns this 401 in ~115 ms (same latency as the local invalid-key path), while the identical anonymous request to a free model returns 200 — confirming no upstream call is involved and the current message is wrong for this branch.Screenshots / recordings
Not a UI change (API error message only).
Checklist