fix(web): resume-retry frozen generations + extraction failure retry#185
Merged
Conversation
Two client-resilience fixes from the 2026-07-20 live self-play findings ledger — both are silent dead-ends today: 1. Freeze-suspension deaths (finding #2): Chromium suspends a background tab's fetches (ERR_NETWORK_IO_SUSPENDED), so any 60-120s generation dies the moment the user tab-switches, and the backend cancels the work on disconnect (sse.generate.cancelled at 145s in the live log). The catch now records whether the error landed while HIDDEN, and a visibilitychange listener fires the banner's own retryLast() once when the tab returns — same fresh-Idempotency-Key path as the manual button. 2. Extraction hard-failure (finding #1): a transient upstream 502 left a rendered page with NO labels, NO codex, NO geo and only a console error as the trace. triggerExtraction already re-fires 0/0-merge flakes; the null (HTTP error / network throw) branch now gets one delayed re-fire too — the route's diff-merge is idempotent. New e2e (mock-only, rides the MOCK_ERROR lever): simulates hiding the tab before the failure lands, asserts the banner appears WITHOUT an auto-retry while hidden, then asserts the second generate POST fires on return with no click.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Two client-resilience fixes from the live self-play ledger (2026-07-20)
1. Freeze-suspension deaths (finding #2). Chromium suspends a background tab's fetches (
ERR_NETWORK_IO_SUSPENDED), so any 60–120s generation dies the moment the user tab-switches — and the backend cancels the work on disconnect (sse.generate.cancelledat 145s in the live log). The user returns to an error banner for something they never watched fail.Fix: the generate catch records whether the error landed while the tab was
hidden; avisibilitychangelistener fires the banner's ownretryLast()once on return — same fresh-Idempotency-Key path as the manual ↻. A real failure simply re-errors and the banner takes over.2. Extraction hard-failure (finding #1). A transient upstream 502 left a rendered page with NO labels, NO codex, NO geo, and only a console error as the trace.
triggerExtractionalready re-fires 0/0-merge flakes; thenull(HTTP error / network throw) branch now gets one delayed re-fire too. The route's diff-merge is idempotent.Spec
New mock-only e2e rides the MOCK_ERROR lever: an init-script visibility override makes the failure land while "hidden", asserts the banner appears with NO auto-retry while hidden (posts stays 1), then flips visible and asserts the second POST fires with zero clicks. First version installed the override after
gotoand lost the race to the sub-second mock error — caught live, moved toaddInitScript.Receipts
🤖 Generated with Claude Code