Skip to content

fix: user-friendly error when OpenAI org is not verified#776

Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:fix/718-design-openai-403-error
Open

fix: user-friendly error when OpenAI org is not verified#776
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:fix/718-design-openai-403-error

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Apr 3, 2026

When a user's OpenAI org isn't verified, $D generate dumps the raw JSON error response — which includes a broken URL (/settings/organization/general returns 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, and evolve.ts which already truncate.

Before / After

demo

Changes

  • design/src/generate.ts:61-64: detect 403 org verification error, throw actionable message
  • Truncate raw error to .slice(0, 200) on the generic fallback path

Testing

bun test passes. 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design binary: raw OpenAI 403 error leaks stale URL for org verification

1 participant