# fix\(server,desktop\): browser tools report why a page failed to load · PR \#18588 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/18588)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: Unavailable fork

Source branch: feat/preview-load-error-v2

Target branch: main

Head commit: 5dbd412d6964143b874134d7b8265e017fdb3af0

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/18588)

[Commits](https://git.cafe/pingdotgg/t3code/pull/18588/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/18588/diffs?format=markdown)

## Description

---

## Problem

After loading `https://self-signed.badssl.com/` in the Browser panel, `preview_status` and `preview_snapshot` show Chromium's error-page URL without a direct explanation of the failed navigation. Agents cannot reliably identify the failed URL and browser error from those results.

## Change

Status and snapshots include an optional `loadError` containing the failed URL, browser error code, and description. Server-rendered tabs retain main-frame failures; desktop-rendered tabs forward failures that happen before server attachment. A new main-frame navigation clears the diagnostic, and replaced guests cannot overwrite the current tab's failure. Diagnostic URLs retain the existing `data:` payload redaction.

Preserves robertnisipeanu's implementation and the existing takeover work, with main merged into the branch.

## Scope and approval

Fixes #18555
GitCafe: https://git.cafe/pingdotgg/t3code/issues/18555
Triaged bug via the automated issue flow. [Issue #18555](https://git.cafe/pingdotgg/t3code/issues/18555).

## Verification

- `apps/server`: `vp test run src/preview/ServerBrowser.test.ts` — 24 passed.
- `apps/desktop`: `vp test run src/preview/Manager.test.ts` — 56 passed.
- Two existing regression tests were extended for `data:` failure URLs. Both failed before redaction with an unredacted payload and pass after the fix.
- Scoped `tsc-rs --noEmit` in contracts, server, and desktop — no errors.
- Targeted lint — clean except the existing `ClipboardItem` warning in `Manager.test.ts`.

Evidence at [5dbd412d69](https://git.cafe/pingdotgg/t3code/commit/5dbd412d6964143b874134d7b8265e017fdb3af0), compared with [8acbefefc5](https://git.cafe/pingdotgg/t3code/commit/8acbefefc51b4d281dcd04108c82baa1ab902b0e):

| Fixture | Before: status and snapshot | After: status and snapshot |
| --- | --- | --- |
| Reporter self-signed.badssl.com | No direct load diagnostic | Failed URL, `-202 ERR_CERT_AUTHORITY_INVALID` |
| Local self-signed HTTPS | No direct load diagnostic | Failed URL, `-202 ERR_CERT_AUTHORITY_INVALID` |
| Blocked port 1 | No direct load diagnostic | Failed URL, `-2 ERR_UNSAFE_PORT` |
| Recovery to working HTTP | Diagnostic absent | Diagnostic absent |

All four rows and eight tool reads passed using the real ServerBrowser, broker, and Chromium 148.0.7778.96 on Linux at 1280×800 with isolated temporary state. Fixture infrastructure used `T3CODE_SERVER_BROWSER_SANDBOX=0`.

[Evidence index](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/04789cd0bae8f8b7/18555-evidence-index.md), [before transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8b9616a60ed11afe/18555-runtime-main-committed.jsonl), [after transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/9dae93dee0ae1bc0/18555-runtime-head.jsonl), [commands](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/30a2538fcab642f4/18555-proof-commands.sh), [harness](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/49501d477e2d9c29/18555-proof-runtime-safe.ts).

Two fresh independent reviews of the complete final diff found no blocking bugs.

This changes tool output without a rendered UI change; the visual fixture matrix is empty. `cannot-verify desktop`: live Electron and native mobile execution were not verified on this Linux VM. Desktop attachment and guest replacement are covered by focused tests.

Implemented with Claude Opus 5.5 and GPT-6.1-Sol through the Claude and Codex harnesses in T3 Code; reviewed with Claude Opus 5.5 and GPT-6.1-Sol.

