# Desktop preview evidence for [#33666](https://git.cafe/pingdotgg/t3code/pull/33666)

Additional observable behavior beyond reattachment recovery: a fresh agent preview_open(open:false) emits one extra unchanged resized event on the reviewed head. F09/F12 records that event and its complete payload.

Captured 3/3 requested paired sequences: F07, F08, F09/F12 (four matrix IDs, six transcripts). Unverified rows: none. F05 and F06 were deliberately not recaptured.

Environment for every row: Linux x86_64 desktop app under headless-desktop (Xvfb 1920×1080, D-Bus session, unlocked GNOME keyring), Electron 44.10.1, --no-sandbox --disable-gpu. Both sides built and ran from their own checkouts with fresh databases created by their own server, T3CODE_DEV_SEED=0, separate T3 homes and Electron XDG profiles. Timestamp source: driver UTC Date.toISOString/Date.now and server trace Unix nanoseconds on the same host clock. The exact commit, home, tracked-tree state and scripted steps are at the top of every transcript. No recorded agent or model identifier is needed for this proof; model identifiers and credentials are absent from the uploaded evidence.

## F07: timeout, quiet interval, late desktop return

| Fixture and environment | Before | After |
| --- | --- | --- |
| F07 — Linux desktop / Xvfb / Electron 44.10.1 | [73fb49d0b3](https://git.cafe/pingdotgg/t3code/commit/73fb49d0b3a61bff74aebc362fc6c17d6c0d39be)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/fa72d3b4871fa410/before-F07.txt) | [f404c5fb33](https://git.cafe/pingdotgg/t3code/commit/f404c5fb33c683ad9e1a00b5983e88259d91ea68)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bfc9dd87ece2f526/after-F07.txt) |

## F08: close during attachment wait, bounded cleanup, late return

| Fixture and environment | Before | After |
| --- | --- | --- |
| F08 — Linux desktop / Xvfb / Electron 44.10.1 | [73fb49d0b3](https://git.cafe/pingdotgg/t3code/commit/73fb49d0b3a61bff74aebc362fc6c17d6c0d39be)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/03e8f975c5049ca6/before-F08.txt) | [f404c5fb33](https://git.cafe/pingdotgg/t3code/commit/f404c5fb33c683ad9e1a00b5983e88259d91ea68)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a17880ac961a9cbd/after-F08.txt) |

## F09-F12: fresh agent open and full unchanged snapshot event payload

| Fixture and environment | Before | After |
| --- | --- | --- |
| F09-F12 — Linux desktop / Xvfb / Electron 44.10.1 | [73fb49d0b3](https://git.cafe/pingdotgg/t3code/commit/73fb49d0b3a61bff74aebc362fc6c17d6c0d39be)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d12a863d476c68c8/before-F09-F12.txt) | [f404c5fb33](https://git.cafe/pingdotgg/t3code/commit/f404c5fb33c683ad9e1a00b5983e88259d91ea68)<br>[Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3c5e79646d8b136c/after-F09-F12.txt) |

## Findings and what else changed

- F07: both sides start with an attached Electron tab at https://example.com/?t=1, then unload the app renderer to about:blank while desktop main, the server, and the desktop channel stay running. The real recovery wait lasts 10001.49 ms before and 10001.34 ms after. Before emits no announcements. After publishes ten unchanged resized announcements, approximately one second apart, during that wait; the separate initial open has one announcement. Neither side makes an announcement attempt after its wait ends. The gated observation extends past two scheduled retry ticks, then the desktop returns late. Both retain headless:true and both subsequent explicit evaluations use server Chromium (Chrome/157) at about:blank, with no competing Electron page. This blank server-page behavior and the manager snapshot retaining the original URL are shared baseline behavior, not introduced by the PR.
- F08: the session is closed by independent preview.close RPC about three seconds into a real 10-second wait. After makes three successful recovery announcements before the closed event, then seven failed missing-session announcement attempts that the caller swallows until the original wait ends; before has no announcement calls. No successful snapshot publish follows close, and no announcement attempt follows wait completion. Both pending evaluations return the ordinary tab-not-found result. Both end with an empty manager list, no surviving native guest page, and a later explicit agent preview_status reporting available:false/tabId:null. UI alerts and error text are empty. The additional subscribed 3.5-second interval sees zero events for this thread on both sides. markHeadless is attempted against the missing session and swallowed on both sides, as in the baseline.
- F09/F12: before emits opened then navigated, with zero resized events. After emits opened, exactly one resized three milliseconds later, then navigated. The complete opened/resized snapshot objects compare equal, including navStatus URL/title, viewport, profile, runtime, automationOwner, reveal and updatedAt; zoom/appearance fields remain absent on both snapshots. The event revision increases by one, createdAt refreshes, and request is absent. Both navigate to the original URL, remain a single tab and return the same Electron UA. Attach waits are 438.84 ms before and 580.11 ms after; normal open tool durations are 988/1028 ms. These timings are observations, not a performance claim.
- Added trace work is observable: after includes isAttached, announce, announceSession and mutation spans for each announcement. Full per-row span lists, trace/parent identities, success/failure exits and derived counts are retained. Initial opens in F07 and F08 also emit one unchanged announcement each on after. Extra events advance the global revision: final F09 revisions are 2/3, F07 5/17, F08 8/24 (before/after).
- Driver/agent variation: after's F09 agent made one preliminary read-only preview_status call returning available:false; before went directly to preview_open. The same prompt/driver was used and this call made no preview mutation. Native request IDs, tab/epoch/owner/thread IDs, timestamps, port numbers, native target IDs, trace IDs, allocation measurements, tool/agent latency and transient startup captions differ between independent runs. No other product outcome difference was observed.

## Scripts and reproduction

The same capture driver and synthetic seed sequence ran on both sides. Agent calls are real thread-scoped MCP preview tools; manager close/list and the independent event subscriber use authenticated server RPC. No service doubles, source instrumentation or tracked edits were used. The renderer gate is CDP Page.navigate(about:blank), followed by Page.navigate(t3code-dev://app/) after the timeout/quiet interval. The backend/browser channel continues running throughout.

capture-run.mjs is the exact executed capture source. Its last DOM error-surface expression had an escaping bug after the F08 close, bounded wait, quiet interval and late-return manager-list capture had completed. The same final-observe.mjs continuation on both sides records DOM error surfaces, native targets, explicit post-close agent status, another subscribed 3.5-second quiet interval and the final manager list. The driver error and continuation are retained in both transcripts rather than hidden. capture.mjs fixes only that escaping expression for reruns. The preliminary status-call variation above is also retained.

Primary scripts:

- [launch-desktop.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/176e51f5884f893a/launch-desktop.mjs)
- [capture-run.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a0fed4e0e45abf4d/capture-run.mjs)
- [final-observe.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5db3f7f8add533cb/final-observe.mjs)
- [capture.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cbd6f800687e59fa/capture.mjs)
- [rpc.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/9a659779be676a74/rpc.mjs)
- [cdp.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/fafc0f0117c2cb46/cdp.mjs)
- [enrich-transcripts.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b846ad0d479c81b8/enrich-transcripts.py)

Exploratory scripts and seed prompt (all retained/uploaded; not substitutes for the six captures):

- [seed-thread.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3002cbd96bd66d63/seed-thread.mjs)
- [watch-events.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5df3cfcf144f6e62/watch-events.mjs)
- [probe-gate.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/44d0fb9b3d73e8ea/probe-gate.mjs)
- [probe-gate-blank.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a6b715b22a0dd8f/probe-gate-blank.mjs)
- [original-cdp-driver.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/494fa66cc6d2a791/original-cdp-driver.mjs)
- [f09-prompt.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/245ae1babbbc3076/f09-prompt.txt)

## Cleanup

All tracked processes from all attempts, including Electron, servers, Vite, Xvfb, D-Bus/keyring and provider children, have stopped; the recorded PID lists contain no surviving processes. The before worktree and its Git worktree registration have been removed. Git initially left a residual apps directory after reporting Directory not empty; the explicitly permitted literal-path shutil.rmtree fallback removed it. The after checkout has no tracked changes. No .t3 directory was created there; fresh homes and retained raw logs live only in the designated scratch directory. No commits, pushes, PR edits or real-database reads/seeds were performed. No browser tab was left open by these desktop runs.

FRICTION:
- tool | Debugger-based renderer gating did not pause the existing desktop renderer; Page.navigate(about:blank) provided a deterministic gate. | Document the blank-document gate for this fixture.
- runbook | An exploratory concurrent launch shared Electron's default profile and triggered single-instance forwarding; a background before open also lacked discovery. | Isolate XDG_CONFIG_HOME/XDG_DATA_HOME per run and foreground the synthetic thread before initial open.
- tool | Native provider filenames were lowercased and shared app-server frames went to the first thread log. | Correlate native request/thread identities across the shared log instead of assuming one log per app thread.
- tool | The final DOM observation expression had an escaping error on both sides after core F08 capture. | Use String.fromCharCode(10); the same continuation completed the missing observation on both sides.
- infra | Git worktree removal reported Directory not empty after removing its registration. | The allowed literal-path shutil.rmtree fallback completed removal.
