Windows elevated sandbox loses logon session (CreateProcessAsUserW error 1312), causing repeated retries and excessive quota usage
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- devtools, operating-systems
Research direction
Start at the Windows elevated sandbox SpawnChild path that calls CreateProcessAsUserW, using the reported error 1312 as the failure case. Trace how repeated failures and permission-reviewer timeouts are handled. Done means the sandbox reports an unrecoverable failure after bounded retries, recommends restarting or switching to unelevated mode, and preserves the task without continued retries.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·