Repository navigation
fix(desktop): Browser Screenshot saves fresh pixels while T3 Code is hidden - #36671
juliusmarminge merged 3 commits into
Conversation
Keep each human capture rendering through a bounded paint probe and warmup, then save the final native pixels. Let overlapping probes progress independently while retaining recording and PiP ownership. Co-authored-by: Julius Marminge <julius0216@outlook.com> > 🤖 Generated by GPT 6.1 Sol in Codex via T3 Code.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Screenshot capture now briefly keeps previews rendering and waits for fresh paint, including while the desktop window is hidden. The change retains existing artifact handling and uses bounded probes and independent rendering leases to limit interference with recording and picture-in-picture. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…regressions Drop cases that re-test existing guest-replacement checks, mock the paint probe's JS through a VM, or assert on debugger ownership the code never takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceLinux desktop, Electron 44.10.1, Xvfb, light theme, 1440×840 window; isolated synthetic state on both commits. Open Browser, capture while shown, then hide for 3 seconds, change the page text/color, and activate Capture screenshot while hidden. Check files before restoring after 4.5 seconds. Repeat with two requests 200 ms apart.
The head temporarily disabled background throttling during captures and restored it afterward. Base observations · Head observations. Actual comparison driver · Counter fixture · Portable launch/setup and scripts · Sanitized runtime/build logs. The counter was paused at deterministic markers to inspect freshness. Video status strips are driver annotations; application pixels are native screen recordings. Captures were visually inspected. Not shown:
|
Sync 1114b: 134 upstream commits to ead133c. Two additive conflicts: desktop preview Manager.ts keeps the fork "automation" frame consumer beside upstream's per-capture symbol lease (pingdotgg#36671); claudeModelOptions.ts keeps the fork output style beside pingdotgg#28024 custom-model thinking and pinnedAlias. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
This is a new PR that replaces #22335, which was closed for staleness. The same single commit is rebased onto upstream
mainat13f89ae0a7.git range-diffreports the patch identical to #22335's last head, and all proof below was regenerated at this base and head. Julius has since mergedmainat121f0cf014and trimmed the still-image tests in dab0ad7.Manager.tsis byte-identical to the proven head932af4cb1d.On Windows and Linux, clicking the Browser panel's Screenshot button while the T3 Code window is hidden saves nothing. Electron's
capturePagenever settles for a preview that isn't being presented, so every retry times out. Each human screenshot now keeps the preview rendering for the duration of the request, waits for a paint through the preview's existing debugger session, discards a warmup capture, and saves the final native readback.This restores the human Screenshot fix from #19931, which #22222 reverted. Julius asked for a fresh PR with real-build before/after proof on every affected platform.
What changed
Validation
Tests, checks, control runs and review status at
932af4cb1d, plusdab0ad7Manager.tsis byte-identical to932af4cb1d,Manager.test.tspassed 85 of 85 locally (Node 24.15.0), and all required CI checks passed. Everything below this bullet was recorded at932af4cb1d, before the merge and test trim.Manager.test.ts: 89 of 89 passed (Node 26.12.1, pnpm 12.14.0).vp run check:changed 13f89ae0a7 --concurrency 1passed at this head: format, lint, both Knip passes, desktop and scripts typecheck, Manager tests. Typecheck printed advisory Effect suggestions only.git diff --checkis clean, and both files are LF.13f89ae0a7fails the same three tests, and the branch fails them identically under Node 24.15.0 and 26.12.1. Neither test file loads Manager.ts at runtime.121f0cf014. None of them touchapps/desktop/src/preview. They do make small changes toensure-electron-runtime.mjsandvite.config.ts.captureScreenshotpath. fix(desktop): capture fresh agent preview frames in background tabs #21534, fix(desktop): agent preview tabs keep working while T3 is hidden #22743 and fix(desktop): agent snapshots of preview tabs no longer stall while the window is hidden #34935 edit Manager.ts for agent preview capture. fix(desktop): capture fresh agent preview frames in background tabs #21534 adds the samesymbolframe-capture consumer type, so whichever PR lands second needs a small merge there. fix(desktop): capture headed browser tabs while macOS is locked #27092, fix(desktop): keep native snapshot retries painting #32412, fix(desktop): capture covered preview surfaces without hanging #33719 and fix(desktop): inactive preview guests stop painting #34681 change capture or guest visibility in other files.Proof
Native before/after on Windows, Linux and macOS at 13f89ae vs 932af4c
Both revisions ran as complete
vp run build:desktopapps (Electron 44.10.1) from clean exact-SHA checkouts. No native build was rerun at dab0ad7, whose merge also changed the desktop build filesensure-electron-runtime.mjsandvite.config.ts. Each run started from a copy of the same existing state: an imported, settled real conversation that was opened before the cases. Every image came from clicking the app's realCapture screenshotbutton, driven by Playwright Electron. No CDP screenshot was used. The page paints a binary epoch counter and a background color, and a standard-library PNG decoder read each saved file.Hidden app, requested epoch 5:
The macOS before and after files are byte-identical, so the upload service stored them once. macOS was not affected in these conditions.
Recording kept throttling disabled after PiP closed, and stopping it restored throttling. After every still capture taken without PiP open, throttling was back on and window focus was unchanged.
Limits:
blur()left the window focused, so the "inactive" case there was effectively shown. Linux BEFORE did not register the minimize.Proof package (zip, SHA-256
fe256a99a2387dedcd57022bdf80bfa7e2fb9dc4d17ab5c28c301d7937214785): every saved PNG, decoder output, native call and throttling observations, Windows display/session events, the driver and decoder scripts, and the Linux container recipe. Profiles, the seed database and app screenshots showing conversation content are excluded.