Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: friendly OpenAI org error on all design commands
Previously only generate.ts showed a user-friendly message when the
OpenAI org wasn't verified. Now evolve, iterate, variants, and check
all detect the 403 + "organization must be verified" pattern and show
a clear message with the correct verification URL.
  • Loading branch information
garrytan committed Apr 5, 2026
commit 481f454a1bd42acd0e5680e7961449c0b79e4d98
4 changes: 4 additions & 0 deletions design/src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export async function checkMockup(imagePath: string, brief: string): Promise<Che

if (!response.ok) {
const error = await response.text();
if (response.status === 403 && error.includes("organization must be verified")) {
console.error("OpenAI organization verification required. Go to https://platform.openai.com/settings/organization to verify.");
return { pass: true, issues: "OpenAI org not verified — vision check skipped" };
}
// Non-blocking: if vision check fails, default to PASS with warning
console.error(`Vision check API error (${response.status}): ${error}`);
return { pass: true, issues: "Vision check unavailable — skipped" };
Expand Down
7 changes: 7 additions & 0 deletions design/src/evolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ export async function evolve(options: EvolveOptions): Promise<void> {

if (!response.ok) {
const error = await response.text();
if (response.status === 403 && error.includes("organization must be verified")) {
throw new Error(
"OpenAI organization verification required.\n"
+ "Go to https://platform.openai.com/settings/organization to verify.\n"
+ "After verification, wait up to 15 minutes for access to propagate.",
);
}
throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`);
}

Expand Down
14 changes: 14 additions & 0 deletions design/src/iterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ async function callWithThreading(

if (!response.ok) {
const error = await response.text();
if (response.status === 403 && error.includes("organization must be verified")) {
throw new Error(
"OpenAI organization verification required.\n"
+ "Go to https://platform.openai.com/settings/organization to verify.\n"
+ "After verification, wait up to 15 minutes for access to propagate.",
);
}
throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`);
}

Expand Down Expand Up @@ -142,6 +149,13 @@ async function callFresh(

if (!response.ok) {
const error = await response.text();
if (response.status === 403 && error.includes("organization must be verified")) {
throw new Error(
"OpenAI organization verification required.\n"
+ "Go to https://platform.openai.com/settings/organization to verify.\n"
+ "After verification, wait up to 15 minutes for access to propagate.",
);
}
throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`);
}

Expand Down
3 changes: 3 additions & 0 deletions design/src/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ async function generateVariant(

if (!response.ok) {
const error = await response.text();
if (response.status === 403 && error.includes("organization must be verified")) {
return { path: outputPath, success: false, error: "OpenAI organization verification required. Go to https://platform.openai.com/settings/organization to verify." };
}
return { path: outputPath, success: false, error: `API error (${response.status}): ${error.slice(0, 200)}` };
}

Expand Down