Skip to content

fix(web): resume-retry frozen generations + extraction failure retry#185

Merged
eren23 merged 1 commit into
mainfrom
fix/web-resilience
Jul 20, 2026
Merged

fix(web): resume-retry frozen generations + extraction failure retry#185
eren23 merged 1 commit into
mainfrom
fix/web-resilience

Conversation

@eren23

@eren23 eren23 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

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.cancelled at 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; a visibilitychange listener fires the banner's own retryLast() 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. 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.

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 goto and lost the race to the sub-second mock error — caught live, moved to addInitScript.

Receipts

  • error-retry spec (both tests): green in 4.7s against the rebuilt web container.
  • Web gates: 772 unit tests + coverage floors, typecheck, lint, circular — all clean.

🤖 Generated with Claude Code

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.
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

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.

@eren23
eren23 merged commit b89d3cc into main Jul 20, 2026
9 checks passed
@eren23
eren23 deleted the fix/web-resilience branch July 20, 2026 10:00
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.

1 participant