fix(server): preview_status tabs list preserves the crashed URL after a renderer crash #48295
main fromrefs/pull/48295/head·opened View on GitHubProblem#
After a headless server preview tab crashes and reopenCrashedTab replaces its dead Playwright page with a fresh about:blank page while preserving tab.crash, preview_status reports the crashed URL in status.url and status.loadError.url but reports url: null for that same tab in status.tabs. In statusWithTitle (apps/server/src/preview/ServerBrowser.ts), status.tabs checked candidate.page.url() === "about:blank" before consulting loadErrorOf(candidate)?.url, whereas top-level statusUrl checked loadError?.url first.
Deterministic repro on origin/main (b020481e35c72c07183cec265dcde54e618e906a):
- Open a headless server preview tab, navigate/commit
https://example.com/app?..., emit a renderercrashevent (soreopenCrashedTabreplaces the page withabout:blankand preservestab.crash), and invokepreview_status(operation: "status"). - Or run the extended crash regression case in
apps/server/src/preview/ServerBrowser.test.ts:vp test run apps/server/src/preview/ServerBrowser.test.ts -t "a tab whose renderer crashes stays open instead of vanishing"
- Observed on
origin/main:status.urlandstatus.loadError.urlare the crashed URL (capped at 2048 chars), whilestatus.tabs.find((entry) => entry.tabId === tabId)?.urlisnull. - Expected:
status.tabs.find((entry) => entry.tabId === tabId)?.urlmatchesstatus.urlandstatus.loadError.url.
Change#
Extracted a shared statusUrlOf(tab, loadError) helper in apps/server/src/preview/ServerBrowser.ts and used it for both status.url and each entry in status.tabs inside statusWithTitle, so loadErrorOf(candidate)?.url is always consulted before falling back from "about:blank" to null. ServerBrowser.ts is the only producer of PreviewAutomationStatus, so this covers all preview_status and automation status responses across web, desktop, and mobile agents; added assertions on status.url and status.tabs to the existing crash test in apps/server/src/preview/ServerBrowser.test.ts.
Scope#
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification#
- Base failure (
b020481e35c72c07183cec265dcde54e618e906a):vp test run apps/server/src/preview/ServerBrowser.test.ts -t "a tab whose renderer crashes stays open instead of vanishing"failed withAssertionError: expected null to be 'https://example.com/app?aaaaaaaaaaaaa…'atstatus.tabs?.find((entry) => entry.tabId === tabId)?.url(whilestatus.urlpassed). - Head pass (
b95b97940b1724cd90d1cdc8c1bea026a58b410a): The same targeted test passed (1 passed | 126 skipped). - Changed checks:
vp env exec --node 26.13.1 vp run check:changedexited0(format,lint,knip,graphql,typecheckacross 3 packages, andtestacross 2 files:129 passed, including all 127 tests inServerBrowser.test.ts). - Before/after transcript: https://gist.github.com/saphid/e0ba53397a47c4c4d3da4c02ce6b9239
- Not shown: Manual live Chromium renderer crash in the full Electron desktop app; verified via
ServerBrowser's realstatusWithTitle/reopenCrashedTabpath overPreviewAutomationBroker.
Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown#
- apps/server/src/preview/ServerBrowser.test.ts:2355 — The transcript exercises the real crash-recovery path with a simulated Playwright event and stops at the broker. Note that a live headless Chromium crash through the MCP endpoint was not run, and that reproducing the red test on base requires applying the two new assertions without the fix.
- scripts/check-changed.ts:490 — The linked transcript contains the focused red/green runs, but not the reported
check:changedexit on HEAD. Attach the HEAD-stamped check summary if available.
- 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:S
Approvability#
Verdict: Approved at
be28a32Macroscope's review found this PR approvable — Preview status tab listings now retain the recorded crash URL when the renderer reports about:blank, matching top-level status behavior. The change is limited to status reporting and preserves existing thread scoping.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).tanstack-source added labelsbug
No actionable comments were generated in the recent review.
Walkthrough
-
The browser status response now uses a shared helper to derive URLs for the active tab and listed tabs. Tests check that crashed-tab URLs are truncated to 2,048 characters.
Changes: Browser status URL handling
Layer / File(s) Summary Derive and report tab status URLs
apps/server/src/preview/ServerBrowser.ts,apps/server/src/preview/ServerBrowser.test.tsA shared helper derives status URLs from load errors or page URLs. The active-tab and tab-list status paths use it. Tests assert that crashed-tab status and tab-list URLs are truncated to 2,048 characters. Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge,tiliakoos
Merge Risk:
Minimal · up tobe28a-
This change makes the preview status tab list keep the crashed page's URL after a renderer crash, matching the top-level status URL. The new test covers the blank replacement-page case. No merge-blocking risk remains.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the fix (preview_status tabs list preserving the crashed URL after a renderer crash) and the affected area (server). The raw summary confirms the change: a shared statusUrlOf helper ma… Description check The description follows the template's main sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, the cause in statusWithTitle, and a deterministic repro with expected… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title names the fix (preview_status tabs list preserving the crashed URL after a renderer crash) and the affected area (server). The raw summary confirms the change: a shared statusUrlOf helper makes listed tabs report the load-error URL even when the page URL is about:blank. The title is specific and matches the main change, though its length (86 characters) is somewhat long.
Full details: Description check
-
Explanation
The description follows the template's main sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, the cause in statusWithTitle, and a deterministic repro with expected and observed behavior. The Change section explains the statusUrlOf helper and the test additions. Scope explains why no issue is linked. Verification lists the base-fail and head-pass runs, the check:changed result, and what was not tested. The template asks for before/after screenshots only for UI changes, which does not apply here. Two items remain open: the 'Not shown' notes flag a missing live headless Chromium crash run and a missing HEAD-stamped check:changed summary. The description also includes a stray t3-pr-hunter tracking comment and an unrelated 'Not shown' section at the end.
Resolution
Optional improvements: attach the HEAD-stamped check:changed summary, state the live headless Chromium crash that was not run, and remove the tracking comment and trailing 'Not shown' notes from the final description.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 43328e8
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
475e4cb1-b2b8-49ed-819b-e7ce22dca0a2
Commits-
Reviewing files that changed from the base of the PR and between 43328e8f0a680a491c84995b398f5c635ff37a90 and be28a325d9c0a299d8fed8e44a6462da09fb4b14.
Files selected for processing: 2-
apps/server/src/preview/ServerBrowser.test.tsapps/server/src/preview/ServerBrowser.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
-
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes