Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): a phone can watch an agent's hidden browser tab while Windows is locked #39198

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/39198/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Refs https://github.com/pingdotgg/t3code/issues/39069

When a tab an agent opened hidden is captured for a remote viewer, the main window stays background-throttled. If Windows is locked, Chromium draws no frames, so the viewer waits on "Connecting to browser..." until unlock. This change takes the same frame-capture lease that recording and still screenshots already take, for the length of each server-driven capture, so the window and the guest stay unthrottled until the capture ends.

Evidence on the Windows 11 VM (development build) and an Android phone, same steps for base and fix:

Base: Windows locked, fresh phone attach to an agent-opened tab, still "Connecting to browser..." at 2 minutes

Fix: same steps, live frame clock at 2 minutes with "Agent has control"

Tested:

  • check:changed (format, lint, knip, typecheck, and the changed test file) on the change.
  • The new case in apps/desktop/src/preview/Manager.test.ts asserts that the window is unthrottled during a server capture and restored after it. It fails on base.
  • Windows VM, UTM, development Electron build: base stalls on a hidden agent tab while locked; this change shows live frames at 30 seconds and 2 minutes while locked.
  • Android phone, paired to that VM build: same two results as above.
  • Linux desktop app on Xvfb: the lease starts and stops around each capture and throttling is restored afterwards (log excerpts in the trace).

Not shown:

  • Physical Windows laptop, or the packaged release. The reporter's laptop was not available.
  • Unlocking the session: the preview continuing after unlock was not shown in a clean run.
  • Agent screenshots of a freshly opened hidden tab on Linux. Base and this change both fail the first capture of such a tab under Xvfb, so there is no clean baseline for that path.
  • CPU and GPU cost of an unthrottled window while a capture is running. No measurement was taken.
  • Android app build used for the phone captures was not recorded.

🤖 Generated with Claude Code

    1. Pushed9930c7a

    2. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The manager now tracks frame-capture leases for server tabs as painting starts and stops. The test supplies a main window and shared host WebContents, then checks that window and guest throttling is disabled during capture and restored afterward.

      Changes: Server-tab capture

      Layer / File(s)Summary
      Capture lease lifecycle
      apps/desktop/src/preview/Manager.ts, apps/desktop/src/preview/Manager.test.ts
      The manager starts and records a lease when painting becomes active, then stops and removes it when painting becomes inactive. It logs capture startup failures and continues to update the capturing state. The test checks that window and guest throttling is disabled during capture and restored after the screenshot resolves.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Possibly related issues

      • pingdotgg/t3code#39069 — The reported viewer stall while Windows is locked is consistent with the capture throttling addressed here; the summary notes that the full fix remains unverified.
      • pingdotgg/t3code#23139 — The reported remote viewing and snapshot stalls share the throttling mechanism addressed here, though the issue summary says occlusion may also contribute.
      • pingdotgg/t3code#17483 — The report concerns throttled hidden agent tabs. This change addresses capture-time throttling of the main window and guest, but through a different code path.

      Possibly related PRs

      • pingdotgg/t3code#25184 — This PR uses the frame-capture lease behavior described in the related PR summary to keep hidden preview tabs painting during capture.

      Suggested reviewers: t3dotgg, juliusmarminge, maria-rcks

      Merge Risk: Minimal · up to 9930c

      The change keeps the window unthrottled during server-driven captures so a locked Windows machine can still stream hidden tabs, and it restores throttling afterward. No concrete defect was found, and the new test covers the main behavior.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the bug and the affected surface (a phone watching an agent's hidden browser tab while Windows is locked), and it uses the conventional fix(desktop) prefix. The changeset adds a frame-…
      Description checkPassedThe description follows the template's main sections. The Problem and Change sections explain the stall on Connecting to browser while locked and how the frame-capture lease fixes it. The Scope sectio…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the bug and the affected surface (a phone watching an agent's hidden browser tab while Windows is locked), and it uses the conventional fix(desktop) prefix. The changeset adds a frame-capture lease for server-driven captures so the main window stays unthrottled. The title describes the user-visible symptom rather than the code change, but it is related to the main change and is specific enough for a teammate scanning history.

      Full details: Description check

      Explanation

      The description follows the template's main sections. The Problem and Change sections explain the stall on Connecting to browser while locked and how the frame-capture lease fixes it. The Scope section links issue 39069. The Verification section gives specific tests and observed results, and it lists what was not checked. The description does not state whether a maintainer requested the PR or explain why an issue is not needed, but the issue link covers the scope requirement. It also omits the model and harness line that the template asks for when an agent was used. The description mentions Claude Code in its footer, so that line is effectively present. The before/after screenshots are included for the UI-visible result.

      Resolution

      Optionally confirm the Scope section's issue link is the bug report, and add the model and harness name in the closing line if the template requires it strictly.

      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
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 1cb3a8c753047efc4fa00600105f5388de8fd7eb and 9930c7af4d293beff2a74ea8698b05c0a6c3aa0f.

      Files selected for processing: 2

      • apps/desktop/src/preview/Manager.test.ts
      • apps/desktop/src/preview/Manager.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Sign in to join this conversation.