Windows elevated sandbox loses logon session (CreateProcessAsUserW error 1312), causing repeated retries and excessive quota usage

Open 💬 1 comment Opened Jul 21, 2026 by LeandroDeMeloGomesDev
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Codex App 26.715.7063.0 (ARM64).

What subscription do you have?

MAX 20X

What platform is your computer?

Microsoft Windows 11 25H2, build 26200 (10.0.26200.0), ARM64 — Snapdragon X Elite.

What issue are you seeing?

Feedback ID: 019f7f4b-a2df-7161-ad82-493ea7363e35

Description

A long-running local coding task remained active for approximately nine hours. After several hours of tool calls and native validation, the Windows elevated sandbox stopped being able to start processes.

Even a trivial PowerShell command failed before PowerShell was launched. The same commands worked when executed outside the sandbox with elevated permission, and the Codex App itself remained responsive.

The active configuration was:

[windows]
sandbox = "elevated"

The exact error was:

windows sandbox: runner failed during SpawnChild:
CreateProcessAsUserW failed: 1312
(A sessão de logon especificada não existe. Talvez ela já tenha sido finalizada.)

English translation:

The specified logon session does not exist. It may already have been terminated.

The local CodexSandboxOffline and CodexSandboxOnline accounts still existed and were enabled. Therefore, this appears to be a stale or invalid logon session/token rather than a missing sandbox account.

After the failure started, Codex repeatedly attempted to recover by launching commands again or requesting elevated execution. Some recovery attempts then failed with messages such as:

automatic permission reviewer expired

and:

command timed out
Exit code: 124

Codex did not recognize that the sandbox session was no longer recoverable. Because a persistent goal was active and I had asked the agent to continue monitoring the work, the task remained in error/retry cycles for hours and consumed nearly all of my weekly quota.

While using Codex with elevated mode (enabled by OpenAI's own build), the agent entered a prolonged failure state that consumed almost my entire weekly usage window.

What happened

  • The agent repeatedly froze due to internal errors.
  • The agent itself reported problems within Codex during the session.
  • Instead of failing fast, it spent approximately 9 hours applying workaround actions to patch its own errors, burning through my quota the entire time.

Expected behavior

  • Errors originating from the Codex build/infrastructure should not consume user quota, or at minimum the agent should halt instead of looping on self-remediation for hours.

What steps can reproduce the bug?

Feedback ID: 019f7f4b-a2df-7161-ad82-493ea7363e35

What is the expected behavior?

Codex should detect the repeated CreateProcessAsUserW error 1312 as an unrecoverable sandbox failure, stop retrying after a limited number of attempts, and display a clear message recommending that the user restart the app or switch temporarily to the unelevated sandbox.

It should preserve the task and worktree state and avoid consuming additional quota by repeatedly reasoning about and retrying the same infrastructure error.

Additional information

_No response_

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #34179

Powered by Codex Action