fix: user-friendly error when OpenAI org is not verified#776
Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Open
fix: user-friendly error when OpenAI org is not verified#776mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Conversation
Detect 403 responses containing "organization must be verified" and show actionable message with the correct verification URL instead of dumping raw JSON. Also truncate generic error fallback to 200 chars for consistency with other design commands. Fixes garrytan#718
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.
When a user's OpenAI org isn't verified,
$D generatedumps the raw JSON error response — which includes a broken URL (/settings/organization/generalreturns 404). This detects the 403 + "organization must be verified" pattern and shows a clean message with the correct verification URL instead.Also truncates the generic error fallback to 200 chars, matching
design-to-code.ts,iterate.ts, andevolve.tswhich already truncate.Before / After
Changes
design/src/generate.ts:61-64: detect 403 org verification error, throw actionable message.slice(0, 200)on the generic fallback pathTesting
bun testpasses. No unit test added — triggering this error path requires an unverified OpenAI org. The E2E design tests run against real API and don't cover error responses.This contribution was developed with AI assistance (Codex).
Fixes #718