# fix\(desktop\): show diagnostics when backend startup keeps failing · PR \#23862 · pingdotgg/t3code

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

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

Visibility: public

State: open

Source repository: pingdotgg/t3code

Source branch: fix/issue-10517

Target branch: main

Head commit: 0c333664e9f9931a4bf716b492fecc0ff3f785b5

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

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

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

## Description

---

## Problem

When the local desktop backend repeatedly crashes before readiness, it cannot serve the renderer, so the app shows no startup diagnostics. Reproduced in the real Linux Electron app by removing `projection_threads.branch_pull_request_json` from an isolated database copy: the child repeatedly exited with `code=1` and `no such column`, with no visible error.

## Change

Show an asynchronous native error dialog after three consecutive startup failures. It displays the failure reason and backend log path, and Copy Diagnostics copies both. Backend retries continue while the dialog is open. Readiness resets the failure streak; bounded preflight retries retain their existing failure handling.

The committed fixture script recreates the isolated database failure and captures the real desktop without production hooks.

## Scope and approval

Fixes https://github.com/pingdotgg/t3code/issues/10517

Triaged bug via the automated issue flow. [Accepted issue and maintainer triage](https://git.cafe/pingdotgg/t3code/issues/10517).

## Verification

Follow-up validation: 46 desktop backend tests passed, including a stop/start regression that failed before resetting the failure streak. Desktop typecheck and targeted lint/format passed. Synthetic fixture experiments verified signal cleanup, explicit source attribution, helper timeouts, and independent server-entry restoration. The captures below retain their stated revisions; the later stop/reset path has test proof and no native recording.

- Red first: the focused regression test failed on main because repeated pre-readiness exits produced zero error dialogs. After the fix and merging main, both backend test files pass: 12 tests. Coverage includes copying the reason/log path, bounded preflight followed by crashes, missing server entry, and continued retries while the dialog stays open.
- Scoped desktop typecheck, lint, and diff whitespace checks pass.
- Real Electron 44.9.3 on Ubuntu 24.04/Xvfb, native GTK light/dark, whole-display 1440×900 and 390×900. [Fixture matrix](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5b1888d9e8fc408d/matrix.md) and [Corrected evidence index, recordings, provenance, differences and row status](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/adbc713d50576e83/index.md).

Evidence: launch the same missing-column database; observe repeated backend exits; after the third failure, keep the dialog open through later retries, then activate Copy Diagnostics. Recordings show timestamped steps and same-session clipboard readback. The four missing-column pairs use exact desktop-main rebuilds of base `ef92441313` and head `be1903680c`; unchanged server/web assets are shared and disclosed. Other variants retain explicitly attributed historical evidence with identical relevant source blobs. The corrected index withdraws the contaminated historical dark baseline.

| Missing-column startup, 1440×900, native light | Before | After | Diff0 / DiffT |
| --- | --- | --- | --- |
| Stills; SHAs `ef92441313` / `be1903680c` | ![Before: desktop has no startup error](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/64bb93eb5bdce6bd/before-action.png) | ![After: native startup error with Copy Diagnostics](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/76d71e19b62bad92/before-action.png) | ![Before, after, amplified Diff0 and DiffT](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b3b4525252eb5a82/f01-1440-light-sheet.png) |
| Startup and copy interaction | [Before recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/77e229f8cb72ec5d/recording.mp4) | [After recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b1c24d68a1a1bb16/recording.mp4) | Diff0 amplified ×8; DiffT max RGB difference >16/255 |

Visible changes: the native error dialog appears on the previously empty desktop, including its message, reason, log path and two actions. Isolated run-home names differ in the path text. Matched healthy-startup controls have zero differing pixels. The index includes all other viewport/theme pairs and cancellation recordings.

Unverified: macOS and Windows native presentation, WSL preflight/fallback paths, unavailable-log text branch, config-resolution failure fixtures, readiness-reset/new-streak sequence, distinct spawn/readiness failures, and native dialog/clipboard rejection. The unavailable-log fixture instead exposed the existing lazy writer advertising a path it cannot append to; the index does not claim that branch was captured. Bare Xvfb has no window manager, so title-bar dismissal/focus behavior is unverified. Web/mobile/contracts/providers are unaffected.

Models: Claude Opus 5.5 and gpt-6.1-sol, through Claude Agent and Codex in T3 Code.

