codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows: repeated WSL workspace probes and WSLg trace-log accumulation associated with disk exhaustion and system instability

Open CLRTechDev opened this issue 1 month ago • 3 comments

Windows: repeated WSL workspace probes and WSLg trace-log accumulation associated with disk exhaustion and system instability

Summary and impact

Impact: maximum disk-space usage (effective disk exhaustion) and system instability, as reported by the owner. The initial system-drive measurement showed only 1,388,544 bytes (approximately 1.32 MiB) free. Diagnostic traces accounted for 40.55 GiB of storage. That is the measured trace-folder size, not a configured cap or a verified all-time maximum.

A WSL-hosted project remained attached to Codex Desktop on Windows after its command runner had failed to start. Later, Procmon recorded repeated repository/configuration probes of that project's \\wsl.localhost path by the Codex Desktop app-server. Nearby WSLg Remote Desktop connection cycles generated diagnostic traces on the Windows system drive.

The incident involved accumulating trace logs, loss of usable disk capacity, and reported system instability; a memory leak has not been demonstrated. Other storage consumers were present, so the measurements do not attribute every consumed byte or each instability symptom solely to these logs. Insufficient Git permissions were initially suspected, but the capture does not establish a Git permission failure or an exclusive causal chain from Codex to all historical log growth.

Why this is easy to miss: disk consumption increases gradually alongside normal Codex use, making it easy to confuse with storage growth from new chats, expanding workspaces/worktrees, dependency caches, and other routine Codex work. Users may attribute the shrinking free space to expected project activity, delaying recognition of the accumulating diagnostic traces until disk capacity and system stability are affected. New chats and workspace expansion are potential sources of misattribution here, not established triggers of the trace growth.

Current status: resolved on the affected machine after a combination of actions reported by the owner:

  • Archival/removal of the project from Codex Desktop.
  • Restarting Codex CLI on both Windows and WSL.
  • Deleting the project folder on WSL.

These actions were combined, so the necessary or sufficient action has not been isolated. This records the owner's successful recovery, not a verified upstream software fix. Folder deletion is part of the incident history, not a proposed general fix for other users.

Environment

Component Observed value
Codex Desktop Installed package OpenAI.Codex_26.1007.9446.0_x64; About-dialog version not separately collected
Windows x64, version 10.0.26200.9711, display version 25H2
WSL 2.6.3.0
Linux kernel 6.6.87.2-1
WSL distribution Ubuntu-24.04
WSLg 1.0.71
WSL Remote Desktop client msrdc.exe file version 1.2.6353.0
Procmon Microsoft-signed 4.12
CLI versions / subscription Not collected

The affected path, with private details replaced, was:

\\wsl.localhost\Ubuntu-24.04\home\<linux-user>\<projects>\<project>

Before the owner's folder deletion, the WSL project directory existed but its .git entry did not. A separate Windows checkout had a .git entry. No evidence establishes how the WSL directory originally lost or lacked its Git metadata. The earlier chat reported an attached workspace whose command runner could not start; it did not identify the underlying failure.

Captured behavior

Procmon used one include rule, Path contains wsl.localhost, with Drop Filtered Events enabled and a bounded 180-second runtime. Collection ran from 2026-10-16 02:59:45.602 to 03:02:52.924 UTC, including startup/shutdown.

  • All 890 exported events matched the filter. 838 (94.2%) came from codex.exe, PID 30552, in app-server mode.
  • Both live process metadata and the trace identified its parent as ChatGPT.exe within the installed Codex Desktop package. The captured caller was therefore the desktop backend; the codex.exe filename alone would not distinguish it from CLI.
  • Requests repeatedly probed .git, .codex, and ancestor directories. Results included 248 NAME NOT FOUND, 26 PATH NOT FOUND, and 480 SUCCESS events. The remaining results were NOT SUPPORTED, FAST IO DISALLOWED, and BUFFER OVERFLOW. No ACCESS DENIED result occurred among those 838 events.
  • One direct Codex probe burst began at 03:02:08.203 UTC, followed by an RDP connection attempt at 03:02:08.619 and a successful connection at 03:02:09.036. The initial gap was 0.417 seconds. Probe bursts were not uniformly once per minute.
  • WSL's msrdc.exe referenced wslg.rdp. The RDP operational log repeatedly showed event IDs 1024/1025/1033/1105/1026, including SL::OnDisconnected with error 0x904.

Traces accumulated under:

%LOCALAPPDATA%\Temp\DiagOutputDir\RdClientAutoTrace

The folder initially contained 43,543,703,552 bytes (40.55 GiB). Removing 2,109 files older than 24 hours reclaimed 42,578,477,056 bytes (39.654 GiB), retaining recent traces. That cleanup alone did not stop accumulation: approximately 9 hours 25 minutes later, the folder was back to roughly 10 GB total (measured 9.15 GB / 8.525 GiB).

Event on October 15, 2026 Local time (EDT) Evidence
Old-log deletion Approximately 1:19–1:21 PM Command launched at 1:19:09 PM; successful completion reported at 1:20:51 PM; 52 recent trace/event-processor files retained
Subsequent size measurement 10:45:36 PM 204 files totaling 9,153,548,288 bytes (9.15 GB / 8.525 GiB)
Approximate interval 9 hours 25–26 minutes About 9.5 hours from the deletion window to the later measurement

The later total is rounded to roughly 10 GB for impact reporting. The exact time the folder crossed 10 GB was not observed, and the retained recent logs mean this is not a measurement of 10 GB of entirely new writes.

Reproduction status

A minimal, deterministic reproducer has not been established. The observed setup was a retained WSL UNC workspace with prior command-runner failure and missing Git metadata, followed by repeated backend filesystem probes and nearby WSLg connection cycles.

For investigation, a disposable WSL workspace could be used to compare valid Git metadata, missing metadata, and denied access independently, then compare project removal and process restarts separately. These are proposed isolation tests, not tests already completed. Ordinary project folders without Git should remain supported.

Expected behavior

  • Workspace access failures should produce an actionable error and bounded retries/backoff, without repeatedly waking WSL when the project is inactive.
  • Removing a project should release associated background monitoring and repository discovery across relevant processes.
  • A missing .git directory should be handled as a non-repository condition without an indefinite retry cycle.
  • The interaction with WSLg should not result in persistent connection churn and trace-log accumulation that exhausts available disk space and destabilizes the system. The trace producer and retention behavior may require separate Microsoft investigation.

Recovery evidence and limits

A second capture used the same filter and a 90-second runtime, spanning 2026-10-16 03:20:04.095–03:21:42.769 UTC, including startup/shutdown. It contained zero matching share accesses. The enabled RDP operational log contained zero events 1024/1025/1026/1033 in that interval.

The exact timing of each owner action relative to this capture was not recorded. The owner subsequently confirmed resolution after the combined Desktop project removal/archival, Windows and WSL CLI restarts, and WSL folder deletion. The quiet capture supports absence of the earlier pattern during that interval; it is not a long-term ETL growth measurement.

There were other WSL activators during the first capture: the investigation's own local reporting hooks invoked WSL, and Docker performed a separate WSL lifecycle operation. These confounders prevent assigning every reconnect or the entire historical trace volume to Codex workspace probing. The ETL files were produced by Microsoft's WSLg Remote Desktop client, not by Codex's conversation storage.

Raw PML/XML files remain local because they contain private paths and process command lines. Only sanitized counts, timing, ancestry, and error summaries are included here.

Related reports

  • openai/codex #41147: internal Git snapshots hash large untracked files into .git/objects, filling the WSL virtual disk. This shares the disk-exhaustion impact, but the storage growth measured here was Windows-side RdClientAutoTrace ETL data written by WSLg's msrdc.exe; this investigation did not establish Git snapshot/object growth as its cause.
  • openai/codex #38079: increasing wslservice.exe handles/threads and lingering node_repl.exe processes during native Windows tool calls, with service-resource recovery requiring a WSL service restart. This shares gradual degradation and system instability, but it does not document the ETL accumulation measured here. This investigation did not measure a handle/thread leak.
  • openai/codex #30048: unwanted WSL startup from Codex Desktop. Related activation behavior; does not establish this log-growth failure.
  • openai/codex #46640: Windows sandbox ACL initialization failures for WSL UNC workspaces. A possible related failure class, not evidence that this incident had the same cause.
  • microsoft/WSL #41418: repeated WSLg Remote Desktop connection cycles, 0x904, and ETL accumulation; a contributor identified periodic WSL share access as a VM wakeup trigger.

Duplicate assessment: related, but not established duplicates of #41147 or #38079. The measured resource, storage location, and immediate producer differ. A shared upstream cause remains possible; these observations support keeping the trace-log failure separately identifiable and cross-linking the reports pending maintainer investigation.

Targeted searches for RdClientAutoTrace, WSL msrdc, and wsl.localhost, followed by direct review of #41147 and #38079 and their available comments, found no confirmed exact match for this captured workspace-probing/log-growth combination. This was not an exhaustive duplicate search.

CLRTechDev avatar Oct 16 '26 05:10 CLRTechDev

Confirmed: Disabling WSLg stops excessive RdClientAutoTrace log generation

I can confirm that I'm experiencing the same issue with Codex Desktop on Windows 11.

Environment:

  • WSL version: 2.4.10.0
  • Kernel version: 5.15.167.4-1
  • WSLg version: 1.0.65
  • MSRDC version: 1.2.5716
  • Direct3D version: 1.611.1-81528511
  • Windows version: 10.0.26300.9974
  • WSL distributions: Ubuntu (WSL2) and docker-desktop (WSL2)

Observed behavior:

  1. When Codex Desktop is running, msrdc.exe is repeatedly launched with the /wslg /silent arguments.
  2. The process is spawned by wslhost.exe.
  3. New .etl files are continuously generated under: %LOCALAPPDATA%\Temp\DiagOutputDir\RdClientAutoTrace
  4. Each log file is approximately 9–10 MB, with a new file appearing roughly every 22 seconds.
  5. The accumulated logs consumed approximately 50 GB of disk space.
  6. The msrdc.exe process ID also changed during monitoring, suggesting that the process was being restarted.
  7. Closing Codex Desktop stopped the continuous log generation.

Confirmed workaround:

I added the following configuration to %USERPROFILE%\.wslconfig:

[wsl2]
guiApplications=false

Then restarted WSL using:

wsl --shutdown

After reopening Codex Desktop, the excessive .etl log generation stopped.

Result:

Disabling WSLg successfully resolves the issue on my machine while preserving normal WSL2 command-line functionality.

This suggests an interaction between Codex Desktop's WSL usage and WSLg/MSRDC. However, the exact underlying cause has not been confirmed.

It would be helpful if Codex Desktop could avoid triggering unnecessary WSLg sessions or if WSLg/MSRDC trace logging could be prevented from growing indefinitely.

I hope these findings help with investigating and reproducing the issue.

quinkk avatar Nov 16 '26 02:11 quinkk

Same issue here, with some data that may help narrow it down.

Environment: Windows 11 Pro 10.0.26300, WSL 2.7.3.0 (msrdc 1.2.6676.0), Codex app 26.1111.2228.0, Docker Desktop 4.99. Ubuntu distro without Node.js or Codex CLI (the probe fails with node: not found, exit 127).

Timeline:

  • Nov 8–9: WSL VM started several times with Codex 26.1103.4239 → no msrdc, no traces.
  • Nov 9 19:29 (UTC-5): Codex 26.1103.7773 installed.
  • Nov 10 07:58: first app launch after the update → loop starts. msrdc /wslg session lasts ~19 s, restarts ~4 s later, ~8 MB .etl per cycle, ~1.2 GB/hour. 9,190 files / 73.5 GB in %TEMP%\DiagOutputDir\RdClientAutoTrace in 7 days.
  • Survived reboots and updates to 26.1106.6628 and 26.1111.2228.
  • .codex-global-state.json has "electron-wsl-remote-connections-migration-enabled": true and the selected remote host remote-wsl:Ubuntu. I never configured a WSL connection, so the migration seems to have added it.
  • The loop came back after it had stopped: Nov 17 22:52:06, the same minute CodexPrimaryRuntime updated from 26.1112.737 to 26.1117.835.
  • Workaround confirmed: unchecking WSL: Ubuntu in Settings → Connections stopped it right away (last trace 11:33:09, none after; msrdc gone, Ubuntu stopped).

Expected: don't auto-enable WSL connections via migration, cache or back off after a missing-CLI failure (exit 127), and surface it as a setup error instead of retrying every ~20 s. Also, runtime updates shouldn't re-enable a probe the user has turned off.

MauPos04 avatar Nov 18 '26 16:11 MauPos04

Follow-up: still reproducible on Codex 26.1111.9664.0 with CodexPrimaryRuntime 26.1118.904.0 (installed Nov 19).

  • With WSL: Ubuntu turned on in Settings → Connections, the loop is the same as before: Ubuntu starts and stops about every 23 s, and each cycle launches a new msrdc.exe /wslg and writes an ~8 MB .etl file (10 files, 88 MB in ~4 minutes).
  • What improved: the UI now shows the failure (WSL connection failed · /mnt/c/Program Files/nodejs/codex: 15: exec: node: not found). But it keeps retrying anyway, so showing the error doesn't stop the loop.
  • Also improved: this update didn't re-enable the connection. A new key remote-connection-auto-connect-by-host-id: {"remote-wsl:Ubuntu": false} kept my setting, unlike the Nov 17 runtime update.
  • Turning the connection off stops the loop right away.

Suggestion: after a failure like exit 127 / missing CLI, stop retrying (or back off a lot) until the user clicks retry, since the error is already shown.

MauPos04 avatar Nov 20 '26 00:11 MauPos04