fix(design/variants): surface real 240s timeout in AbortError message#1774
Open
Pablosinyores wants to merge 1 commit into
Open
fix(design/variants): surface real 240s timeout in AbortError message#1774Pablosinyores wants to merge 1 commit into
Pablosinyores wants to merge 1 commit into
Conversation
`generateVariant` in `design/src/variants.ts` arms its abort timer at 240_000 ms (`setTimeout(() => controller.abort(), 240_000)` at line 61), but the AbortError branch at line 128 returns `"Timeout (120s)"` — half the actual bound. The mismatch is purely a stale string literal, but it's the only signal a caller gets when the API stalls. A user staring at `Timeout (120s)` has no way to know whether to bump the orchestrator timeout, retry, or drop the call — the surfaced number is off by 2x from the timer that fired. Surface the real bound: "Timeout (240s)". Adds a regression test that stubs fetch to a permanently-pending promise, fast-forwards only the 240_000 ms abort timer (leaves the leading exponential retry delays on their real values), and asserts the surfaced error string matches the configured bound.
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
generateVariantindesign/src/variants.tsarms its abort timer at240_000ms:but the AbortError branch returns
"Timeout (120s)"— half the actual bound:A user staring at
Timeout (120s)has no way to know whether to bump the orchestrator timeout, retry, or drop the call — the surfaced number is off by 2x from the timer that fired. This is purely a stale string literal, but it's the only signal a caller gets when the OpenAI Responses API stalls.No linked issue — caught while auditing
design/src/after #1773 (thegpt-image-2regression).Fix
One-line literal correction in
variants.ts:128:"Timeout (120s)"->"Timeout (240s)".Regression test
Adds a test to the existing
design/test/variants-retry-after.test.tsthat:fetchto return a permanently-pending promise wired to the AbortSignal.setTimeoutto fast-forward ONLY the240_000ms abort timer (delegating all other delays — including the retry-loop exponential backoff — to the realsetTimeoutso other behaviors aren't affected).result.error === "Timeout (240s)".Without the fix this test fails with the pre-fix
"Timeout (120s)"literal.Validation
(The existing 5 retry-after tests still pass; the new 6th test is the regression pin for the AbortError branch.)
AI assistance disclosure
Patch was drafted with AI assistance. Diff hand-reviewed against
variants.ts:61(the abort timer) andvariants.ts:128(the error branch); test exercises the actual AbortError code path rather than asserting the literal directly so a future timeout change keeps the message and the timer in lockstep.