fix(web): retry startup after the server recovers #11291
main fromrefs/pull/11291/head·merged by maria-rcks View on GitHubA 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:
After:
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.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 13.6 KiB 13.5 KiB −66 B (−0.5%) 15.1 KiB ✅ Codex Thread snapshot wire 7.0 KiB 7.0 KiB +6 B (+0.1%) 7.3 KiB ✅ Codex Live turn WebSocket wire 6.6 KiB 6.5 KiB −72 B (−1.1%) 7.8 KiB ✅ Codex Live turn WebSocket decoded 57.1 KiB 57.0 KiB −88 B (−0.2%) 66.4 KiB ✅ Codex Live turn messages 10 8 −2 (−20.0%) 21 ✅ Claude Total thread wire 13.6 KiB 13.6 KiB −38 B (−0.3%) 15.1 KiB ✅ Claude Thread snapshot wire 7.1 KiB 7.1 KiB +1 B (+0.0%) 7.3 KiB ✅ Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −39 B (−0.6%) 7.8 KiB ✅ Claude Live turn WebSocket decoded 57.9 KiB 57.8 KiB −88 B (−0.1%) 66.4 KiB ✅ Claude Live turn messages 10 8 −2 (−20.0%) 21 ✅ Baseline:
20363c3· PR result:e330a61· Source CI: successScenario 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.
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.tsxRootRouteErrorViewnow obtains the router withuseRouter(). The “Try again” button callsvoid router.invalidate().Priority: ➖ Normal
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
e330aThe 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly and concisely describes the main change: enabling startup recovery after the server recovers. Description check ✅ Passed The 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.maria-rcks merged thise628683
maria-rcks closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
00e2e5eMacroscope'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
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).e330a61. Prior analysis still applies.