Skip to content

Windows: sandbox broker wedges conversation thread across client restarts (deny-read ACLs -> silent hangs, spinning codex-windows-sandbox-setup); evidence of ACE accumulation (TokenDefaultDacl error 1344) #34842

Description

@Lut3ce

Summary

On Windows, the interactive Codex client's sandbox execution broker can enter a wedged state in which every spawned operation (cmd, PowerShell, Node, git, filesystem writes, browser startup) hangs indefinitely and ignores timeouts. The wedge is conversation-thread-scoped and persists across a full client restart: restarting Codex and resuming the affected conversation re-attaches to the same broken broker, and subagents spawned inside that thread inherit it. Fresh codex exec processes and brand-new conversations on the same machine work normally during the entire incident.

Environment

  • Codex CLI: codex-cli 0.144.6
  • OS: Windows 11 Home, build 10.0.26200
  • Sandbox modes affected: default sandbox in interactive sessions (workspace-write)

Original error

Before the hang state, the client surfaced:

windows sandbox: helper_unknown_error: apply deny-read ACLs

After that, all spawns hung silently.

Minimal reproduction (inside an affected thread)

  • Command: cmd.exe /d /c echo sandbox-health-ok
  • Directory: C:\tmp (any directory reproduces)
  • Expected: immediate output
  • Actual: no output; the process timeout is ignored; the outer tool has to terminate it

Isolation evidence

Probes run inside the affected conversation after a full client restart + thread resume:

Probe Spawns a process? Result
Root shell canary (cmd.exe /d /c echo ...) yes hung
Fresh subagent running the same canary yes (inherits thread broker) hung
Non-mutating apply_patch parser no (in-process) responded normally (~0.2 s)
External codex exec dispatches, same machine, same hour yes (new process tree) all completed (multiple long multi-hundred-k-token runs incl. git push, pytest, cargo)

Additional system-level evidence: each hung canary left behind an orphaned codex-windows-sandbox-setup process spinning CPU indefinitely (~6–7 CPU-minutes each at ~19 MB RSS before being killed manually). Three such processes accumulated, their start times matching the three hung probes to the second.

Follow-up evidence (same day, after recovery)

In a brand-new conversation on the same machine (after killing the orphaned helpers), the very first spawn failed fast with:

windows sandbox: runner failed during SpawnChild: SetTokenInformation(TokenDefaultDacl) failed: 1344

Win32 error 1344 is ERROR_ALLOTTED_SPACE_EXCEEDED ("No more memory is available for security information updates") — the token's fixed-size default-DACL buffer overflowed. An immediate retry of the same command succeeded. Together with the original apply deny-read ACLs failure, this suggests the sandbox setup accumulates ACEs (in the token default DACL and/or object ACLs) across runs until security-information writes start failing, and that the helper's handling of that failure is inconsistent: sometimes a fast error (recoverable), sometimes the indefinite busy-loop described above (unrecoverable for the thread). A reboot/fresh logon session appears to reset the accumulated state.

Interpretation

The conversation thread appears to hold a persistent binding to a sandbox/execution broker that crashed or deadlocked after the ACL error. Client restart does not recycle that binding when the thread is resumed; subagents inherit it. The per-spawn codex-windows-sandbox-setup helper then spins forever (busy-loop, not a blocked wait, given the CPU burn) instead of failing fast, which is why timeouts are never honored.

Impact

  • An affected conversation can still converse (in-process operations work) but cannot execute anything, which is confusing to diagnose.
  • Timeout settings are silently ignored, so automation on top of the client stalls indefinitely.
  • Orphaned sandbox-setup helpers leak CPU until killed manually.

Workaround

  1. Abandon the affected conversation; start a brand-new one (or use codex exec). Do not resume the wedged thread — resuming re-attaches the broken binding even after client restart/reinstall.
  2. Kill leftover codex-windows-sandbox-setup processes (identifiable by abnormal cumulative CPU).
  3. Health-check any new context with a cheap canary first: cmd.exe /d /c echo canary-ok.

Suggested fixes

  • Recycle/re-create the sandbox broker binding on client restart rather than persisting it with the resumed thread.
  • Make codex-windows-sandbox-setup fail fast (propagate helper_unknown_error instead of busy-looping) and honor the caller's timeout.
  • Avoid unbounded ACE accumulation in the token default DACL / object ACLs across sandbox runs (root cause of error 1344).
  • Surface a visible "execution broker unhealthy" state instead of silent hangs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingperformancesandboxIssues related to permissions or sandboxingsessionIssues involving session (thread) management, resuming, forking, naming, archivingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions