[Bug]: Windows: resident server-browser host's chrome-headless-shell GPU process (SwiftShader) busy-spins ~5 cores for hours while idle
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Steps to reproduce
Not fully deterministic yet; this is the observed state on my machine.
- Use the app with agent HTML previews (
html_preview/html_renderthrough the shared server browser). The desktop app spawns a residentchrome-headless-shell.exehost with--user-data-dir=...\.t3\userdata\server-browser\profiles\default. - Stop using previews and leave the app running (no active turns, preview panel not in use).
- Hours later the machine is hot, the fan is loud, and Task Manager shows
chrome-headless-shelleating most of the CPU.
Expected behavior
The resident server-browser host should not burn CPU when nothing is being previewed or captured. Ideally it would throttle/stop compositing when idle, or exit after an idle timeout and respawn on demand.
Actual behavior
The --type=gpu-process child of the resident host busy-spins continuously while everything else is idle:
- Host
chrome-headless-shell.exe(PID 13844) was spawned byT3 Code (Nightly).exeat 13:13:29 and stayed resident showingabout:blank. - At ~16:14 its GPU process (PID 65860) had accumulated 913.9 CPU-minutes (15.2 CPU-hours) over ~3 h wall time — a steady ~5 of 16 logical cores, i.e. ~72% total machine CPU.
- The renderer processes had ~0.2–0.3 CPU-seconds each, so the work was all in the GPU process.
- Launch flags: host has
--disable-gpu --force-device-scale-factor=2; the GPU process runs--use-angle=swiftshader-webgl --enable-unsafe-swiftshader, i.e. pure CPU rasterization with no real GPU. - Killing the whole tree dropped machine CPU from 73% to 3.6% within seconds.
This looks related to the family of "hidden/unused preview surfaces keep consuming resources" bugs — #17180 (Linux stale preview tab holding a "Capturing" wake lock), #14730 (macOS hidden previews still rendering), #15579 (hidden webviews stay alive until restart) — but this one is the Windows server-browser host's SwiftShader GPU process spinning while idle, not a stale visible tab.
Impact
Major degradation or frequent failure
Version or commit
0.0.46-nightly.20261011.2955
Environment
Windows 11 Pro 10.0.22631, Intel i7-10700F (8 cores / 16 threads), desktop app (nightly channel), bundled chrome-headless-shell 154.0.8037.92
Logs or stack traces
chrome-headless-shell 72.1 % (top process; total machine CPU 73.0 %, 16 cores)
t3 code (nightly) 0.5 %
everything else <= 0.4 %
Process tree (Win32_Process + Get-Process):
PID 13844 chrome-headless-shell.exe started 13:13:29 CPU 0.1 min
parent: 39972: T3 Code (Nightly).exe
cmdline: ...\t3\tools\chrome-headless-shell\win64\154.0.8037.92\chrome-headless-shell.exe
--disable-gpu --force-device-scale-factor=2 --headless --hide-scrollbars
--user-data-dir=...\.t3\userdata\server-browser\profiles\default
--remote-debugging-pipe about:blank
PID 65860 chrome-headless-shell.exe --type=gpu-process started 13:13:29
CPU 913.9 min (15.2 CPU-hours) Mem 572 MB <-- the burner
flags: --use-angle=swiftshader-webgl --enable-unsafe-swiftshader
PID 73276 --type=utility (network service) CPU 0
PID 45000 --type=renderer created 16:04:16 CPU 0.3 s
PID 30640 --type=renderer created 16:14:41 CPU 0.2 s
After Stop-Process -Id 13844 (whole tree):
chrome-headless-shell: all gone
Total CPU now: 3.6 %
Workaround
Kill chrome-headless-shell.exe (or restart the app) whenever the fan spins up. It respawns on the next preview with no visible data loss.
[!NOTE] Grok responding on behalf of Julius.
This is a real bug: the resident server-browser host is launched with --disable-gpu (so Chromium keeps a SwiftShader GPU process), and nothing on main tears that host down when previews go idle.
What main does
- Launch args are
--disable-gpuand--force-device-scale-factor=2(ServerBrowserContexts.launchOptions). The file comment says that deliberately keeps SwiftShader WebGL while using software compositing — which matches your--use-angle=swiftshader-webgl --enable-unsafe-swiftshaderGPU child. - The default profile uses
chromium.launchPersistentContext(...), so the host stays up under.t3/userdata/server-browser/profiles/defaultafter the first preview. - Idle cleanup only closes unused agent tabs after 30 minutes (
AGENT_TAB_IDLE_MS/closeIdleAgentTabs). Closing a tab drops the page; for the default profile it does not close the persistent context. The chrome-headless-shell tree is disposed only when the server browser itself shuts down. - There is no host-level idle exit or respawn-on-demand.
So your process tree (resident host on about:blank, GPU child burning CPU, renderers idle) matches the architecture. Chromium is also known to keep a GPU process under --disable-gpu and route WebGL through SwiftShader; the multi-hour busy-spin on a blank page looks like that path misbehaving, but T3 is what leaves the host running for hours with nothing to do.
Not a duplicate of / not covered by
- #15579 / #17180 / #14730 — desktop Electron preview guests / wake locks, not the shared
chrome-headless-shellhost. - #16921 — host eviction on automation timeouts.
- #17090 — WSL stream lag while using a preview.
- Open PR #18147 — keeps desktop-rendered tabs out of the agent idle sweep; it does not idle-exit or retarget the headless host.
Workaround
Kill chrome-headless-shell (or restart the app) when the fan spins up; it comes back on the next preview. Until there is a host idle timeout (or a less hungry GPU setup), that remains the practical fix.
I did not reproduce the spin at runtime; the lifecycle and flags above are from current main.
Hi @juliusmarminge , I’d like to investigate this issue. I’ve read the contribution guidelines and your explanation of the persistent browser host’s lifecycle.
I propose investigating host-level idle cleanup and relaunch on demand, ensuring active previews and browser operations remain protected. I’d add focused lifecycle tests and seek Windows validation of the reported CPU usage. I also noted that #18147 addresses desktop-rendered tab cleanup rather than this headless-host issue.
If this is available, could you please assign it to me and confirm whether that approach fits the intended scope? Thanks!
Additional macOS observation, possibly related, but not a confirmed reproduction of the Windows idle spin.
Environment: macOS 27.0.1, arm64; T3 Code Nightly 0.0.46-nightly.20261013.3080.
During an active agent-work session, a read-only process-tree monitor observed the following. CPU is the difference in cumulative process CPU time over approximately 10 seconds; 100% means one logical core.
| UTC timestamp | Process | Parent | CPU | RSS |
|---|---|---|---|---|
| 2026-10-14 02:02:56 | chrome-headless-shell PID 40165 | T3 server PID 7204 | 0% | 50 MiB |
| 2026-10-14 02:02:56 | chrome-headless-shell PID 40166 | PID 40165 | 100% | 117 MiB |
| 2026-10-14 02:12:58 | same PID 40165 | T3 server PID 7204 | 0% | 64 MiB |
| 2026-10-14 02:12:58 | same PID 40166 | PID 40165 | 0% | 53 MiB |
The load subsided without killing processes, hiding the app, reloading, or changing configuration during monitoring.
Limitations: active agent count and preview/capture activity were unknown at those timestamps. These are discrete samples, not evidence of ten minutes of continuous load or idle spinning. The retained measurement records identify the executable and parentage but do not establish the child role or launch flags for this particular sample. This may be useful as a macOS investigation lead, not proof of the same root cause.
Other high aggregate CPU readings in this session were attributable to Python subprocesses under the Codex agent. They should not be treated as evidence of this headless-browser issue. Summed RSS and system-wide swap also do not establish a T3 memory leak.
Reproduced on macOS arm64 (M-series, 10 cores, 0.0.46 nightly, bundled chrome-headless-shell 154.0.8037.92). The live GPU process used 379 CPU-minutes in one hour while its renderers used about 2.5. I traced the cause and have a measured trigger and fix.
What happens
- A background or delegated thread's agent tab falls back to headless, because the desktop host only attaches tabs for mounted chat views. That fallback is #16620's bug.
- Headless-shell runs WebGL through SwiftShader inside the GPU process.
--disable-gpudoesn't prevent that, and in my runs removing the flag barely changed CPU (341% → 309%). The SwiftShader worker pool is min(cores, 16) threads, and each spin-yields for about 1 ms before it sleeps.sampleshows exactly that:Thread<00..09>inlibvk_swiftshader.dylibwithcthread_yield/swtch_pri, plus mutex contention, the GPU main thread busy about 98%, andVizCompositorThreadidle. - Nothing throttles unwatched tabs. Playwright's default args disable background throttling, and DSF 2 quadruples the pixel work. The tab lives until
AGENT_TAB_IDLE_MS(30 min), and the host never idle-exits.
Measurements. Same binary, Playwright 1.60.0 and the exact ServerBrowserContexts launch options, with one fullscreen WebGL rAF page:
| Config | GPU process | Renderer |
|---|---|---|
| T3 flags (DSF 2) | ~310% | ~7% |
| DSF 1 | ~220% | |
Without --disable-gpu |
~309% | |
+ --disable-software-rasterizer |
0% (WebGL unavailable) | |
| Static page, with or without a screencast viewer | ~0–15% |
A matching external report, gstack #2709 (Chromium 151, Apple Silicon, 740–830%), was also fixed by adding --disable-software-rasterizer.
End to end, I compared current main with main + #16620 in isolated dev desktops. With main, a background-thread agent opening a WebGL page launched headless and its GPU process sat at ~390–450%. With #16620, the same tab opened in the desktop <webview> and no headless browser started. Details are on #16620.
Onset. The flags, DSF 2, the idle timeout and the screencast pipeline all came in with #15328 (2026-10-06, first nightly 0.0.46-nightly.20261006.2735) and haven't changed since. Chrome stayed on 154.0.8037.92 the whole time, so this isn't a Chromium update.
Suggested fixes
- Land #16620, so local desktop users rarely go headless at all.
- Cap the fallback's cost. Either
--disable-software-rasterizer(or--disable-3d-apis), accepting that headless pages lose WebGL, or render at DSF 1 when no viewer is attached. - Close idle agent tabs sooner, and let the host exit when idle.
- Caveat on freezing.
Page.setWebLifecycleState({state: "frozen"})on a Playwright CDP session did not stop the rAF loop in my test (still 23 fps), so freezing unwatched tabs needs verification before anyone relies on it.
Additional Windows incident: high CPU and memory pressure clear after quitting T3
Reporting another observed incident that appears related to #18165, on a newer Windows nightly. This report adds system measurements, a shutdown/recovery observation, and preview timeout traces. The exact browser-process role and root cause were not captured before shutdown.
What happened and impact
On 15 October 2026, around 19:00–19:10 EAT, Elson reported that the PC was hot and asked what was consuming resources. A live diagnostic found system CPU at 100%, almost all physical RAM in use, and a chrome-headless-shell process as the strongest CPU-load candidate in an initial process scan. The user then closed T3 Code. The headless-shell processes disappeared, CPU and RAM use fell, and the user reported that the PC felt smooth again.
Impact: substantial machine-wide slowdown and user-reported heat during ordinary use. Hardware temperature was not measured.
Verified environment
| Component | Value |
|---|---|
| Application | T3 Code (Nightly), installed Windows desktop build |
| Installed file version | 0.0.46-nightly.20261013.3053 |
| Release commit | 6524a8d43795dc543f7cfb572388cdea3662ad48, from the matching official release |
| OS | Windows 11 Pro x64, 10.0.26300, build 26300 |
| CPU | Intel Core i5-10310U, 8 logical processors |
| Physical RAM visible to Windows | Approximately 15.8 GiB |
| Incident timezone | EAT, UTC+03:00 |
The installed executable's version was inspected after shutdown. The exact binary version of the now-exited process was not independently captured while it was running. The T3 session's provider/model, preview page, active tab count, rendering API, and whether the browser was idle at the time were not established.
Before/after measurements
These are successive live snapshots, not a controlled benchmark or evidence of sustained CPU use at each percentage.
| Observation | System CPU | Used physical RAM | Free physical RAM | Browser-process state |
|---|---|---|---|---|
| Initial investigation, before T3 shutdown | 100% | ~15.0 GiB | ~0.8 GiB | Five chrome-headless-shell processes observed |
| After the user closed T3 | 54% | ~12.8 GiB | ~3.0 GiB | No chrome-headless-shell or T3 Nightly processes found |
| Subsequent check | 20% | ~13.1 GiB | ~2.7 GiB | Still no headless-shell or T3 Nightly processes found |
The percentages above are machine-wide readings from Win32_PerfFormattedData_PerfOS_Processor, with 100% meaning the whole machine. RAM came from Win32_OperatingSystem.
The initial process scan singled out chrome-headless-shell PID 24156; CIM subsequently identified its parent PID as 11652. The executable path, command line, parent application, and --type role could not be established before the processes exited. Its creation timestamp was 2026-10-15T15:59:56.883Z.
The first per-process CPU sampler produced an invalid value above 100% on a whole-machine scale because its sampling windows were not aligned across process enumeration. That percentage is intentionally excluded. A valid numeric CPU percentage for this particular process is not claimed.
Other applications remained open and were consuming RAM. Neither the system RAM reduction nor aggregated process working sets proves a T3 memory leak. A disk snapshot during the slowdown showed 0% busy time and queue length 0; this was not a sustained disk trace.
Relevant preview logs
Only operational excerpts are included. Times below are UTC on 15 October 2026; add three hours for local time. Local usernames, home paths, environment IDs, thread IDs, and private agent conversation content are omitted.
From ~/.t3/userdata/logs/desktop.trace.ndjson:
15:59:45.009362Z PreviewManager.createControlSession
durationMs=13899.9738; exit=Success
15:59:45.010423Z PreviewManager.initializeControlSession
durationMs=13898.8161; exit=Success
For comparison, another control-session creation earlier that day completed in about 286 ms. That is a different session, not an equivalent controlled performance test.
From ~/.t3/userdata/logs/server.trace.ndjson:
16:02:14.994978Z PreviewAutomationBroker.awaitResponse
durationMs=54133.8733; exit=Failure
PreviewAutomationTimeoutError: Preview automation open timed out after 660000ms.
16:05:28.215429Z PreviewAutomationBroker.awaitResponse
durationMs=16119.7618; exit=Failure
PreviewAutomationTimeoutError: Preview automation navigate timed out after 15000ms.
The open timeout text reports 660,000 ms, while the recorded broker span lasted approximately 54.1 seconds. Both values are preserved as recorded; this report does not assume the operation actually consumed 660 seconds. Nested invoke/toolkit failures for the same requests were not counted as separate incidents.
Renderer-history samples from the recent desktop session showed the main renderer at approximately 196–279 MiB working set and the preview renderer at approximately 87–133 MiB. Those are different PIDs from the hot headless-shell candidate. The renderer samples do not explain or measure the headless browser's CPU consumption.
Reproduction status
This was an observed incident followed by recovery when the user quit the app. A deterministic fresh-session reproduction was not performed. T3 was not restarted solely to recreate a machine-wide slowdown.
Observed sequence:
- T3 desktop was running, and its operational logs show preview control initialization and subsequent open/navigation timeouts.
- The user experienced heat and poor responsiveness; diagnostics found CPU saturation, memory pressure, and the headless-shell candidate described above.
- The user closed T3.
- T3 and the headless-shell processes were no longer present, resource use declined, and responsiveness improved.
The temporal association supports investigating the browser/preview path. It does not establish SwiftShader busy-spinning, a GPU-process role, an orphaned tab, an idle-host defect, or whether a slow page caused the timeouts or vice versa.
Expected behavior and workaround
Preview work should remain bounded and recover or release resources when it stalls. Normal use should not leave a background browser monopolizing the machine. Quitting T3 should clean up its browser processes.
The observed workaround was closing T3, which the user did themselves. No process was killed by the reporting agent, and no settings, browser flags, application data, or installation files were modified.
Relationship to existing reports
- #18165 is the closest existing report: Windows headless-shell CPU load and recovery after stopping the browser/app. This incident adds a newer installed nightly and timeout evidence, but does not independently prove its established SwiftShader/idle-host mechanism.
- #16921 concerns preview timeout/host-eviction failures. The timeouts here are relevant context, but a host-eviction cascade was not established in this incident.
A useful next capture would identify the headless child's role and parent chain, measure aligned per-process CPU deltas, and correlate preview activity with the onset and cessation of load. No specific implementation change is claimed or requested as a verified fix.
Filed by
Filed by OpenAI Codex, using model gpt-6.1-sol with high reasoning effort, through the Codex 0.162.1 harness. Verified runtime metadata reports session originator codex-tui, integration/source vscode, and model provider openai.
Filed on behalf of Elson (@justelson) with his explicit authorization. This reporting agent inspected the live machine and existing logs from outside the affected T3 session. The reporting agent/model should not be interpreted as the provider/model that was running inside T3.
Additional macOS arm64 incident on T3 Code (Beta) 0.1.0, observed on 18 October 2026. This appears to match the headless/SwiftShader path reported here; the expensive page activity itself was not identified.
Observed behavior
A session had left a browser tab open. Activity Monitor showed the bundled chrome-headless-shell consuming 549.10% CPU (100% = one core). A subsequent live ps snapshot showed 382.3% for the same process. The user reports that closing the tab stops the load.
The hot process was conclusively identified as the GPU subprocess, rather than inferred from its executable name:
T3 Code (Beta) PID 4206
chrome-headless-shell PID 95722
chrome-headless-shell PID 95734 --type=gpu-process
Bundled browser: chrome-headless-shell/mac-arm64/154.0.8037.92
Parent flags (selected):
--headless
--disable-gpu
--enable-unsafe-swiftshader
--force-device-scale-factor=2
--disable-background-timer-throttling
--disable-backgrounding-occluded-windows
--disable-renderer-backgrounding
GPU child flags (selected):
--type=gpu-process --headless --use-angle=swiftshader-webgl
At a later check, PID 95734 was still alive but reported 0.0% CPU, with cumulative CPU time 285:00.31 and elapsed wall time 01:17:03. That is accumulated CPU usage over its lifetime, not proof that a particular percentage persisted continuously.
Stack sample and log correlation
A native sample was taken with sample 95734 3 -file <local-output> at 09:10:55.751 UTC (15:10:55.751 UTC+06). It shows the GPU main thread entering libvk_swiftshader.dylib and multiple Thread<NN> workers executing in that library. Representative excerpt, with binary addresses/offsets omitted:
Thread_40142328 com.apple.main-thread
... chrome-headless-shell frames ...
... libvk_swiftshader.dylib ...
vkGetInstanceProcAddr (libvk_swiftshader.dylib)
_pthread_cond_wait
__psynch_cvwait
Thread_40142626: Thread<00>
... vkGetInstanceProcAddr (libvk_swiftshader.dylib) ...
Thread_40142627: Thread<01>
... vkGetInstanceProcAddr (libvk_swiftshader.dylib) ...
The waiting main-thread excerpt alone is not evidence of a spin; the live CPU readings and worker activity identify the costly software-rendering process. The stripped binary does not provide sufficiently reliable symbols to name the exact rendering operation.
Sanitized operational log excerpts:
~/.t3/userdata/logs/server.trace.ndjson
2026-10-18T09:11:08.295100Z preview.close
durationMs=217.60; status.code=1
2026-10-18T09:11:08.300745Z PreviewManager.close
durationMs=11.10; exit=Success
~/.t3/userdata/logs/desktop.trace.ndjson
2026-10-18T09:11:08.519309Z desktop.ipc.preview.closeTab
durationMs=1.10; exit=Success
2026-10-18T09:11:08.519349Z PreviewManager.closeTab
durationMs=1.06; exit=Success
2026-10-18T09:11:08.519471Z PreviewManager.closeTabUnlocked
durationMs=0.91; exit=Success
This successful close falls between the hot stack sample and the later 0% process reading, consistent with the user's report that closing the tab resolves it. No browser processes were killed, no app restart was performed, and no launch flags were changed during diagnosis.
Environment: macOS 27.0.1 (26A434), ARM64. App version 0.1.0 is independently present in the installed Info.plist, packaged package.json, and server trace service.version.
Limits / expected behavior
This was captured in an existing affected session, not a deterministic fresh-session reproduction. The page URL/content, whether it used WebGL, and whether a capture consumer remained attached were not established. This evidence should not be interpreted as proving that an empty/blank page spins, or that disabling the GPU flag alone would fix it.
Leaving a tab open without active use should not monopolize several CPU cores. This adds macOS Beta 0.1.0 evidence and a tab-close recovery timeline to the existing report. Private URLs, profile/session identifiers, local usernames, and full raw logs are omitted.
Additional macOS ARM64 observation on Nightly 0.1.1-nightly.20261019.3360, macOS 27.0.1, bundled Chrome Headless Shell 154.0.8037.92.
The confirmed GPU subprocess consumed approximately one CPU core for 35 minutes. Two native stack samples showed VizCompositorThread continuously busy, while SwiftShader worker threads were waiting. A separate blank tab still executed JavaScript and returned a screenshot promptly.
A preview close was logged at 16:01:06 CEST; the original renderer subsequently exited and GPU-process CPU dropped to 0%, remaining idle across repeated checks. No process was killed or restarted.
The original page and deterministic trigger weren’t established. This may be related, but the busy compositor differs from the SwiftShader worker activity described above.
Linux server (containerized) confirmation — Nov 2026
Adding a Linux data point to this issue. Same root cause: the resident server-browser's GPU subprocess (--type=gpu-process, SwiftShader) busy-spins indefinitely.
Environment: T3 Code server runtime 0.1.9, containerized Linux (no GPU), chrome-headless-shell 157.0.8103.38.
Observed state:
| Process | PID | CPU | Memory | Uptime |
|---|---|---|---|---|
| Main browser host | 11453 | 0% | 0.5% | 6d 7h |
| GPU process (SwiftShader) | 11474 | 293% | 21% (1.6 GB) | 6d 7h |
| Network service | 11477 | 0% | 0.1% | 6d 7h |
| Renderer (active) | 435894 | 0.8% | 2.1% | ~33 min |
| Renderer (active) | 436053 | 0.7% | 2.5% | ~33 min |
The GPU process had accumulated 138 CPU-minutes and grown to 1.6 GB RSS. System load average was 6.98/10.17/15.14 on a container with 100% CPU pinned to userspace. No preview tabs were actively in use.
Key flags on the GPU process:
--type=gpu-process --use-angle=swiftshader-webgl --enable-unsafe-swiftshader
--ozone-platform=headless --headless
Parent process chain: PID 11474 → 11455 (zygote) → 11453 (main browser) → 33 (t3 serve --host 0.0.0.0 --port 3773). Confirmed T3-managed, not Playwright or user code.
Resolution: kill 11474 (SIGTERM) immediately dropped CPU to 0% idle, freed ~1.8 GB RAM and ~200 MB swap. Load average fell from 6.98 to 3.66 within seconds. The main browser process survived.
This confirms the issue affects Linux server environments in addition to Windows desktop and macOS. The 6-day uptime and 1.6 GB memory footprint suggest the GPU process also leaks memory over long sessions, beyond the CPU spin.