design: bump per-image OpenAI timeout from 120s to 240s#1638
Open
ionianFury wants to merge 1 commit into
Open
Conversation
The hardcoded 120-second abort in design/src/{generate,iterate,variants,evolve}.ts
fires too often against the gpt-image-1 image_generation tool at the
default quality:"high" + size:"1536x1024". A real session today had
all 3 `variants` calls timeout at exactly 120s while the OpenAI API
was actively processing — direct curl with max-time 240s returned 200
in 33s.
Bumping each call to 240s gives ~2x headroom over typical worst-case
(60-180s observed) while staying under user patience. Quality default
unchanged — high is what produces the polished mockups users expect;
the timeout was the cliff, not the quality.
Touches 5 sites:
- design/src/generate.ts:40
- design/src/iterate.ts:85, 133
- design/src/variants.ts:61
- design/src/evolve.ts:55
All carry an inline comment explaining the picked value. A future
follow-up could promote this to an env var (GSTACK_DESIGN_TIMEOUT_MS)
or a shared constant in design/src/constants.ts, but I'm keeping this
PR small.
Verified: bun install + bun build --compile design/src/cli.ts succeeds.
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.
Summary
The hardcoded 120s
setTimeout(() => controller.abort(), 120_000)indesign/src/{generate,iterate,variants,evolve}.tsfires too often againstgpt-image-1at the defaultquality: "high"+size: "1536x1024". Real session today (mid-2026): all 3design variantscalls timed out at exactly 120s while the OpenAI API was actively processing the request. Directcurl --max-time 240to the same endpoint with the same payload returned 200 in 33s.Bumping each call to 240s.
Why 240s
high + 1536x1024: typically 60-180s, occasionally 200s+ under provider load.Sites touched
design/src/generate.ts:40design/src/iterate.ts:85, 133design/src/variants.ts:61design/src/evolve.ts:55Each carries a brief comment pointing back to
generate.tsfor the rationale.What I deliberately did NOT change
high. That's what produces the polished mockups skill users expect. The timeout was the cliff, not the quality.design/src/constants.tsor aGSTACK_DESIGN_TIMEOUT_MSenv var, but I'm keeping this PR small. Happy to follow up if you want the env-var or shared-constant change in a separate PR.Verification
No test changes — the timeout itself isn't easily unit-testable without injecting a stub clock or a slow mock fetch, and the existing
design/test/suite doesn't cover it today.Repro
(Filed by ionianFury — happened to me mid-
/plan-design-reviewtoday.)