Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Agent shell fan-out on Windows stalls mouse/keyboard delivery machine-wide for 20–70 s; recovery coincides with mass process exit #45749

Openbzbetty(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On native Windows (not WSL), open the desktop app and run 3–4 concurrent jobs whose work is shell-heavy (git operations, builds, file inspection — anything that makes the agent issue frequent Bash tool calls). Each Bash call spawns bash.exe + a hidden conhost.exe + cygwin-console-helper.exe, so sustained fan-out reaches 10–28 new processes per second.
  2. While the jobs run, use the machine normally (any app — the effect is not limited to the T3 window).
  3. To observe it objectively, run a 1 Hz input watchdog that logs the age of the last event seen by its own WH_MOUSE_LL/WH_KEYBOARD_LL hooks, GetLastInputInfo, GetCursorPos, and a per-second PID-set diff (count + names of new processes). I can supply the script (PowerShell + C# Add-Type, hooks on a ThreadPriority.Highest STA thread).
  4. During spawn bursts above roughly 8–10 processes/second, interact with the machine.

Not perfectly deterministic — it needs enough concurrent fan-out — but on this machine it reproduces several times per hour of normal multi-job use, and the watchdog catches every episode with timestamps.

Expected behavior

Agent shell activity may consume CPU/IO, but host mouse/keyboard delivery stays responsive.

Actual behavior

During fan-out bursts, mouse and keyboard input stops being delivered system-wide for 20–70 s at a time: GetCursorPos freezes, the low-level hooks see no events, and GetLastInputInfo stops advancing, while the user is actively clicking and typing. Input resumes at the exact second the spawned process group exits en masse.

Two episodes captured in one morning (2026-11-30):

Episode A, 08:57:25–08:57:46 (~21 s). User actively clicking/typing (foreground was a taskbar jump list the user had opened and could not dismiss). Cursor frozen at one coordinate; hook event ages climb linearly to 20.6 s. Process count rises 526 → 666 (+140) in 13 s during the stall. Input resumes at 08:57:45–46 — the same two ticks in which the count collapses 666 → 498 (~170 exits).

Episode B, 10:39:04–10:40:16 (~72 s total). A 24 s full blackout (cursor pinned, GetLastInputInfo age 23.9 s), a 2 s recovery, then 3–6 s stutter-stalls for another 40 s; button-press age peaked at 72.7 s before clicks were delivered.

The watchdog's own loop and hook thread never stalled during any episode (ticks stayed at 1 s intervals), so the stalls are the OS not delivering input, not the monitor starving.

Control case: the same host shows the same input stall under a completely different spawner — an Intune detection script that triggers a Win32_Product repair pass (~250 msiexec spawns in 30 s). So the mechanism is generic process/console-creation churn; agent fan-out is simply the dominant recurring source on a machine running T3 jobs.

Relation to existing issues: #28901 / #40140 measure the server's own git calls as startup/polling overhead. This report is about agent-tool fan-out while jobs run, and the impact is loss of interactivity for the whole desktop, not extra process cost.

Likely mechanism (hypothesis): the desktop server is a GUI-subsystem process, so every console child gets a new conhost.exe (per #28901). Console host creation/teardown goes through win32k — the same component that delivers input to the raw input thread. Dozens of hidden console creations per second across several concurrent jobs appear to hold win32k locks often enough to starve input delivery entirely. Defender real-time scanning of each short-lived process likely widens each window (enterprise-managed devices cannot turn it off).

Possible directions: extend the console-free approach from #28901/#40140 to agent tool execution (persistent shell/pseudoconsole per job instead of a fresh bash+conhost per command); rate-limit or pool process creation across concurrent jobs on Windows; offer a supported "run job shells in WSL" mode so the churn happens inside the utility VM instead of host win32k.

Impact

Blocks work completely

Version or commit

Desktop 0.1.14-nightly.20261129.5452

Environment

Windows 11 Enterprise 26300, i7-12700 (8P+4E, 20 threads), 64 GB RAM. T3 Code (Nightly) desktop with 3–4 concurrent Claude jobs. Git for Windows provides the Bash tool shell. Defender + MDE real-time on; performance mode unavailable (disabled by tamper-protected org policy, common on managed enterprise devices).

Logs or stack traces

Per-second watchdog lines during Episode B (format: event ages from LL hooks, system last-input age, cursor, process count, new-process names):


10:39:05.174 move=1.4s btn=1.2s key=35.2s sysInput=1.2s cur=-458,1527 procs=595 new=12 spawned=[bashx5 conhostx3 cygwin-console-helperx2 gitx1 podmanx1]
10:39:06.214 move=2.5s btn=2.3s key=36.2s sysInput=2.3s cur=-458,1527 procs=597 new=11 spawned=[bashx5 nodex2 tailx1 cmdx1 conhostx1 cygwin-console-helperx1]
10:39:11.342 move=7.6s btn=7.4s key=41.3s sysInput=7.4s cur=-458,1527 procs=601 new=10 spawned=[conhostx3 bashx3 cygwin-console-helperx2 podmanx2]
10:39:24.615 move=20.9s btn=20.7s key=2.5s sysInput=2.5s cur=-458,1527 procs=620 new=0
10:39:28.703 move=0s   btn=24.8s key=1.3s sysInput=0s  cur=-670,1306 procs=623 new=0   <- partial recovery
10:40:11.592 move=5.9s btn=67.6s key=44.1s sysInput=5.9s cur=-527,1330 procs=646 new=1
10:40:20.833 move=0s   btn=0.4s  key=3.3s sysInput=0s  cur=1740,1110 procs=582 new=28 spawned=[bashx6 gitx5 conhostx4 shx4 cygwin-console-helperx2 podmanx2]
10:40:21.877 move=0s   btn=1.5s  key=0.6s sysInput=0s  cur=-830,970  procs=578 new=21 spawned=[bashx4 conhostx3 gitx2 wslx2 shx2 podmanx2]


Full 1 Hz logs for both episodes and the watchdog script available on request.

Screenshots, recordings, or supporting files

No response

Workaround

None found that preserves the workflow. Stalls only occur while jobs are fanning out, so running fewer concurrent jobs reduces frequency. Moving job workloads into WSL/cloud sessions should avoid host conhost churn but isn't a supported mode.

  1. bzbetty(GitHub profile, opens in a new tab) added labelsneeds-triage

Sign in to join this conversation.