fix(web): retry startup after the server recovers#11291

merged1
main
fix/web-startup-retry
openedSep 11, 2026bySshivam
View on GitHubTwo-way sync enabledPR last imported 16d ago

A failed startup session probe leaves the root error screen visible after the server recovers. "Try again" only resets the error boundary, so it never retries the failed route loader. The button now calls router.invalidate() to rerun the startup probe and open the app when it succeeds.

Refs #3513. This covers manual retry; the reported session-store write failure and automatic recovery remain open. It follows the request in #3520 for a current reproduction.

Reproduction and validation

Reproduced on main 7bd7f99e6cab940892ff9240549c507bfd066aee in a real Chromium client against disposable T3 state. Intercept /api/auth/session with the DevTools Fetch domain and return HTTP 500, load the app, then allow the request through and click "Try again". Before this change, the error remains and the request count stays unchanged. Afterward, one fresh request succeeds and the app opens. Retrying while the endpoint still returns 500 retains the error screen, and a later retry recovers.

18 auth bootstrap tests and web typecheck pass. Scoped lint reports two existing React warnings. Web and desktop share this error screen; native desktop boot and remote/relay recovery were not separately exercised. Mobile uses separate navigation.

Before, after clicking "Try again" with a recovered endpoint:

Retry remains on the error screen

After:

Retry opens the app

Recovery recording:

https://github.com/user-attachments/assets/8c2f4680-8e41-4845-b96a-b5ff4a350a79

Model: GPT-6. Harness: Codex in T3 Code.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the “Try again” action on error pages so it refreshes the current route and retries loading more reliably.

Rebased on main 20363c32c9bfdbf49c2716ef11d1f18483fcc01b. Scoped validation rerun after rebasing; existing native and human review limits remain.

Synced from GitHub

Approvability

Verdict: Approved at 00e2e5e

Macroscope's review found this PR approvable — This single-file fix makes the existing Try again action rerun the failed startup loader, allowing the web app to recover after the server returns. Its effect is limited to explicit interaction with the existing error screen, with no default, schema, infrastructure, or security changes.

No code changes detected at e330a61. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.5 KiB−66 B (−0.5%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB+6 B (+0.1%)7.3 KiB✅
CodexLive turn WebSocket wire6.6 KiB6.5 KiB−72 B (−1.1%)7.8 KiB✅
CodexLive turn WebSocket decoded57.1 KiB57.0 KiB−88 B (−0.2%)66.4 KiB✅
CodexLive turn messages108−2 (−20.0%)21✅
ClaudeTotal thread wire13.6 KiB13.6 KiB−38 B (−0.3%)15.1 KiB✅
ClaudeThread snapshot wire7.1 KiB7.1 KiB+1 B (+0.0%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.6 KiB6.5 KiB−39 B (−0.6%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.9 KiB57.8 KiB−88 B (−0.1%)66.4 KiB✅
ClaudeLive turn messages108−2 (−20.0%)21✅

Baseline: 20363c3 · PR result: e330a61 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 52c62d92-a378-457c-ae92-4b2ddb0ffcd1

📥 Commits

Reviewing files that changed from the base of the PR and between 00e2e5ee2eec31f62f96d28c68218e31e89f9b4a and e330a615b03f11ca945741d90a8cca59bff2d6df.

📒 Files selected for processing (1)
  • apps/web/src/routes/__root.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The root route error view now obtains the router and uses router.invalidate() when the user selects “Try again” instead of calling the error boundary reset function.

Changes

Root route retry flow

Layer / File(s)Summary
Router invalidation retry
apps/web/src/routes/__root.tsx
RootRouteErrorView now obtains the router with useRouter(). The “Try again” button calls void router.invalidate().

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to e330a

The retry flow recovers when the server returns, while repeated failures leave the existing error screen available.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Title check✅ PassedThe title clearly and concisely describes the main change: enabling startup recovery after the server recovers.
Description check✅ PassedThe description explains what changed, why it changed, the reproduction steps, validation results, scope limits, and UI behavior. It includes screenshots and a recovery recording. The template Checkli…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/web-startup-retry

Comment @coderabbitai help to get the list of available commands.

Added 1 commit

  • fix(web): retry startup after the server recoverse330a61