GeezerVison is showing github.com — fix(desktop): agent snapshots of preview tabs no longer stall while the window is hidden by juliusmarminge · Pull Request #34935 · pingdotgg/t3code
Conversation
When an agent or remote viewer captures a server tab, DesktopBrowserHost publishes painting and the client draws the guest. But PreviewManager.updateServerTabCapturing only set the tab's capturing flag and left the main window background-throttled. A minimized, hidden or covered window then drew no frames, so the capture timed out. Recording and picture-in-picture already turned throttling off; this path did not. The fix tracks the server tabs currently being painted in a set, updated under the same frameCaptureSessionsRef lock that recording and picture-in-picture use. Throttling goes off when the first painting tab starts while no frame-capture session exists, and comes back on only when the last painting tab stops with no sessions left. stopFrameCapture and startFrameCapture's rollback do not re-throttle while a painting tab remains, and setMainWindow unthrottles a replacement window if any are active. Nothing visible changes beyond captures working while the window is not on screen. No regex or parser was added. I reproduced the bug with the repro branch's failing test, not with the real minimized-window flow.
Fixes #23139
Reproduction on main
Commit bfec275 (origin/main). Ran T3CODE_DEV_SEED=0 vp run dev:desktop under headless-desktop (Xvfb) with openbox as window manager, fresh database, project in a scratch folder, Codex agent. Window on screen: preview_open https://example.com (open:false, reuseExistingTab:false) then preview_snapshot includeImage:true -> success in 128 ms, 1280x800 image. Minimized the main window with xdotool windowminimize (WM_STATE Iconic; main page visibilityState 'hidden'), then a new turn: preview_open on a fresh tab -> success 185 ms (visible:true); preview_evaluate requestAnimationFrame probe -> 'no rAF in 3s' (3,029 ms); preview_snapshot includeImage:true -> 10,019 ms, 'Preview snapshot failed: Preview automation snapshot timed out after 15000ms.' (PreviewAutomationTimeoutError). Restored the window with wmctrl -a, then preview_snapshot on the same tab -> success, 1280x800 image. Tested minimized only, not a covered window on Windows and not Android remote viewing.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/preview/Manager.test.ts in apps/desktop: 72/72 pass with the fix. Without the fix, the repro test 'asks the client to paint a navigated server tab while the agent captures it' fails (1 failed, 71 passed). vp run check:changed: format initially failed, fixed with vp fmt; lint, knip, typecheck (2 packages) and tests pass. The pre-push hook re-ran fmt, lint and knip: all pass.
Not in this change
- I did not re-run the real minimized-window flow (Xvfb + xdotool + agent preview_snapshot) after the fix; the unit test asserts the throttling calls.
- The painting-tab set is not cleared when the main window closes. Painting ends when the host's capture settles or the tab detaches, so I left it alone.
AI-assisted; verified with the tests and tools listed above.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…#23139)
A hidden, minimized or covered main window commits no frames while
throttled, so agent snapshots of server tabs time out. This test fails
on main: the capture never turns the main window's throttling off.
AI-assisted; verified with the tests and tools listed above.
…he window is hidden
Server tab captures ask the client to paint the guest, but the main
window stayed background-throttled, so a minimized, hidden or covered
window drew no frames and the capture timed out. Keep the main window
unthrottled while any server tab is being painted for a capture, the
same way recording and picture-in-picture already do.
Fixes #23139
AI-assisted; verified with the tests and tools listed above.
Approvability
Verdict: Approved at 7190b74
Macroscope's review found this PR approvable — Preview captures temporarily keep the desktop window rendering even when hidden, then restore background throttling once captures finish. The change is limited to local capture-time rendering and resource use.
No code changes detected at ccd6811. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 12, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
The manager now tracks server tabs that are painting and uses that state with capture-session state to control main-window background throttling. The screenshot capture test checks that throttling is disabled and restored during capture.
Changes: Server-tab throttling
| Layer / File(s) |
Summary |
Track server-tab painting apps/desktop/src/preview/Manager.ts |
The manager tracks painting server tabs by key. When no capture sessions exist, changes to the set update main-window background throttling. |
Apply combined throttling state apps/desktop/src/preview/Manager.ts, apps/desktop/src/preview/Manager.test.ts |
Capture-session setup and shutdown, and main-window installation, account for painting server tabs. The screenshot test checks that throttling is disabled and then restored during capture. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: shivamhwp
Merge Risk: Minimal · up to ccd68
-
The change keeps background throttling disabled while a server tab is being captured, so snapshots should no longer stall when the window is hidden. No concrete merge-blocking issue was found. The real minimized-window and covered-Windows flows were not re-tested after the fix.
Pre-merge checks: 2 · 1 · 1
-
Failed checks: 1 warning · 1 inconclusive
| Check name |
Status |
Explanation |
Resolution |
| Description check |
 |
The description follows the template sections (Problem, Change, Scope, Verification, agent attribution). It explains the throttling bug and the fix in detail. It links the issue (#23139) and gives rep… |
Add the before and after evidence the template requires for UI-adjacent behavior. Upload the screenshots or a short recording of the minimized-window snapshot working after the fix, then embed or link them in the Evidence section. Also stat… |
| Linked Issues check |
 |
[#23139] requires agent snapshots and remote viewing to keep working while the Windows T3 window is completely covered. The diff in apps/desktop/src/preview/Manager.ts adds a paintingServerTabs set. W… |
Run the issue's covered-window reproduction on Windows 11 with this change. Include preview_open, preview_evaluate, and preview_snapshot with and without includeImage while another window fully covers T3. Also confirm that the Android remot… |
Passed checks: 2 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: agent snapshots of preview tabs no longer stall while the window is hidden. The changeset adds main-window background-throttling control for server tabs that are being… |
| Out of Scope Changes check |
 |
All production changes in Manager.ts relate to background-throttling state for server-tab capture. They cover the new paintingServerTabs set, the guarded update under frameCaptureSessionsRef, stopFram… |
Full details: Title check
-
Explanation
The title names the main change: agent snapshots of preview tabs no longer stall while the window is hidden. The changeset adds main-window background-throttling control for server tabs that are being painted, which matches this title. It follows the conventional commit format from the template and is specific enough for a teammate scanning history.
Full details: Out of Scope Changes check
-
Explanation
All production changes in Manager.ts relate to background-throttling state for server-tab capture. They cover the new paintingServerTabs set, the guarded update under frameCaptureSessionsRef, stopFrameCapture and startFrameCapture rollback conditions, and setMainWindow unthrottling. Manager.test.ts adds a setBackgroundThrottling spy and assertions for the server-tab capture path, which supports the same objective. No unrelated refactoring or feature change appears in the reviewed diff. The PR description's note that the set is not cleared on main-window close is a known limitation, not an unrelated change.
Full details: Description check
-
Explanation
The description follows the template sections (Problem, Change, Scope, Verification, agent attribution). It explains the throttling bug and the fix in detail. It links the issue (#23139) and gives reproduction steps and test results. The Scope section does not explain the link as a bug report with an issue, but it does link one. The Evidence section is a placeholder that says before and after captures will be added before merge. That is a required UI-change item that is still missing. The description also says the covered-window Windows case and the Android remote viewer case were not tested, so the fix may not cover the full linked issue.
Resolution
Add the before and after evidence the template requires for UI-adjacent behavior. Upload the screenshots or a short recording of the minimized-window snapshot working after the fix, then embed or link them in the Evidence section. Also state whether the covered-window case from issue #23139 is expected to be fixed. If it is not, say so in the Scope section and consider narrowing the linked issue reference. Confirm the agent model and harness used, as the template asks.
Full details: Linked Issues check
-
Explanation
[#23139] requires agent snapshots and remote viewing to keep working while the Windows T3 window is completely covered. The diff in apps/desktop/src/preview/Manager.ts adds a paintingServerTabs set. When a server tab starts painting and no capture session exists, the code calls setFrameCaptureBackgroundThrottling(false). When the last painting tab stops, it re-throttles. setMainWindow and the startFrameCapture rollback also honor the set. This path is not limited to minimized windows, so it may apply to covered windows. The author did not test a covered Windows window or an Android viewer after the fix. The author's own repro is minimized Xvfb, and the author did not rerun it after the fix. The issue also states that Chromium occlusion is not established as the sole cause. The diff does not prove that the covered-window stall is fixed. Missing evidence: a run of the covered-window flow on Windows (or an equivalent covered-window run) after this change, with preview_snapshot succeeding while another window fully covers T3, and with an Android remote viewer connecting.
Resolution
Run the issue's covered-window reproduction on Windows 11 with this change. Include preview_open, preview_evaluate, and preview_snapshot with and without includeImage while another window fully covers T3. Also confirm that the Android remote viewer connects. Record the results in the PR Evidence section.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The automated pipeline stopped on this pull request and will not merge it:
the capture step could not show the problem on the base commit, so there is nothing to prove fixed.
On both commits: create the synthetic project and replay thread; open https://example.com with open:false and reuseExistingTab:false; request preview_snapshot with includeImage:true as the foreground control; minimize the actual Electron main window; open another fresh tab with the same options through HTTP MCP; snapshot it while isMinimized() remains true; restore the main window and snapshot that same tab again. All requests succeeded on both commits. Recorded base snapshot times: foreground 185 ms, minimized 252 ms, restored 248 ms. Head: foreground 375 ms, minimized 191 ms, restored 116 ms. All six returned PNGs were byte-identical. Background throttling was enabled after each completed request.
It stays open for a person to finish or close.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for this. Main has the change since #39198.
Main now holds the existing frame-capture lease whenever DesktopBrowserHost requests painting for a server tab, keeping the main window unthrottled until capture ends. I compared both Manager.ts implementations and their regression assertions: the shared lease covers this PR’s painting-tab bookkeeping, overlapping recording/PiP ownership, throttling restoration, and replacement-window handling.
Closing as superseded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
takeover:blocked
Takeover blocked; reason in the PR body
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|