Skip to content

Windows desktop freezes while electron-sampler fails WMI process snapshots in sandbox #22912

@iAxvleda

Description

@iAxvleda

What version of the Codex App are you using?

Codex Desktop 26.506.3741.0 from the Windows MSIX package path:

OpenAI.Codex_26.506.3741.0_x64__2p2nqsd0c76g0

What platform is your computer?

Microsoft Windows [Version 10.0.26200.8457]

What issue are you seeing?

Codex Desktop repeatedly freezes/stalls for a few seconds during normal UI interaction, including sending a message, streaming a response, moving the app window, and resuming/opening threads.

This still happens after reinstalling Codex Desktop and after disabling a previously active heartbeat automation. It also reproduces when no custom pet/avatar is active, so this does not appear to be a custom pet rendering/cache issue.

The app logs repeatedly show electron-sampler failing to collect a child process snapshot. The command it runs uses PowerShell/WMI, and it fails inside the Codex Windows sandbox with access denied.

Representative redacted log excerpt:

warning [electron-sampler] Failed to collect child process snapshot
errorMessage="Command failed: powershell.exe -NoProfile -NonInteractive -Command
$ErrorActionPreference = 'Stop';
$cpuByPid = @{};
Get-CimInstance Win32_PerfFormattedData_PerfProc_Process |
  ForEach-Object { $cpuByPid[[int]$_.IDProcess] = [double]$_.PercentProcessorTime };
Get-CimInstance Win32_Process |
  Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,
    @{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},
    @{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} |
  ConvertTo-Json -Depth 2
"

Get-CimInstance : Zugriff verweigert.

Running the same WMI checks from a normal user PowerShell session succeeds. Running them from the Codex sandbox user fails. The sandbox command context reports the user as:

<HOST>\CodexSandboxOffline

The local Windows groups Leistungsüberwachungsbenutzer / Performance Monitor Users and Leistungsprotokollbenutzer / Performance Log Users were empty, which likely explains why CodexSandboxOffline cannot read those WMI classes.

Additional observations

The same sessions also show long thread/resume / metadata operations around the freezes, for example:

method=thread/resume conversationId=<redacted> durationMs=58400 errorCode=null
method=thread/goal/get conversationId=<redacted> durationMs=58558 errorCode=-32600
error={"code":-32600,"message":"goals feature is disabled"}

method=thread/metadata/update conversationId=<redacted> durationMs=47839 errorCode=null

That may be separate from the sampler issue, but both show up around the observed stalls.

Related: #21774 mentions later sampler warnings after a Windows desktop restart, but this issue is specifically about recurring UI freezes/stalls while electron-sampler repeatedly fails WMI process snapshots from the Windows sandbox context.

Steps to reproduce / local checks performed

  1. Start Codex Desktop on Windows with the default/elevated Windows sandbox configuration.
  2. Use the app normally: open/resume threads, send a message, move the window, wait for a streamed response.
  3. Observe repeated short UI freezes.
  4. Check Codex logs under %LOCALAPPDATA%\Codex\Logs.
  5. Observe repeated electron-sampler warnings with the WMI Get-CimInstance command above.
  6. Verify that the same WMI command succeeds outside Codex's sandbox but fails from the sandboxed CodexSandboxOffline context.

Expected behavior

Codex Desktop should not freeze because a diagnostic/sampling command cannot access WMI process counters from the sandbox. If WMI access is unavailable, the sampler should either skip that data source, handle access denied cheaply, or avoid running the command from a sandbox token that lacks the required rights.

Actual behavior

The app repeatedly attempts the WMI process snapshot from the sandboxed context, logs access-denied failures, and the desktop UI freezes/stalls intermittently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions