Infinite configure Sandbox agent loop
What version of the Codex App are you using (From “About Codex” dialog)?
26.515.10909
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64 (Windows 11 Pro)
What issue are you seeing?
So, after the latest update of Codex App it started asking me to configure agent Sandbox and the problem is: every time I click set up it succeeds... but after a few seconds it asls me to do it again and again and again.. I work on a local drive.
<img width="2560" height="1600" alt="Image" src="https://github.com/user-attachments/assets/44628fce-d039-4610-8ab5-15c13e8f2644" />
<img width="2560" height="1600" alt="Image" src="https://github.com/user-attachments/assets/2d984158-17fc-48d1-ad81-40c6322e5959" />
sandbox.log
setup_marker.json Here are the logs
What steps can reproduce the bug?
- Open codex App
- Click on setup Agent sandbox.
- It actually succeeds
- And than it asks you to do it again and again and again...
What is the expected behavior?
The Codex App always will tell you that it configured agent sandbox successfully but then it will ask you to click set it up again. And There it is... The infinite loop has started...
Additional information
Here are the additional logs that might help you solve this issue:
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
You can still run Codex via PowerShell and ask Codex to fix the problem form there.
Codex Desktop was stuck at "Set up Agent sandbox to continue" for all projects.
Root cause appears to be a version mismatch:
C:\Users\calle\AppData\Local\OpenAI\Codex\bin
The Windows sandbox itself worked from CLI:
codex sandbox windows cmd.exe /c "chcp 65001 > nul && dir /b"
After replacing the stale user-local bin files with the newer files from the installed Desktop package resources folder, Desktop was able to continue.
it sounds like you're facing a loop detection issue where the configuration state isn't persisting correctly. log every write to track if the setup is being redundantly triggered. check for identical-write storms or oscillation between two states. implementing a deduplication guard at the write layer could help prevent the repeated setup prompts. also, ensure that the configuration is actually being saved to a durable backend that survives restarts. Use Octopoda OS or ZEP
Hey! Noticed you are dealing with agent loops/token bleeding here.
I was facing the exact same issue with infinite reasoning loops burning API credits, so I built a lightweight algorithmic handbrake in Python to stop it.
It audits the execution and automatically freezes the agent if it hits the same error 3 times in a row. It might save you some headaches and API costs while you debug the core issue.
You can drop it in your workflow: https://github.com/gedeon1972-svg/loop-guardian-skill
Hope it helps you save some tokens! Let me know if it works for your use cas
What usually makes this kind of loop expensive is not the sandbox setup itself, it is the app never graduating from "setup requested" to a durable "setup already satisfied" state.
If the setup flow really succeeded, the next launch should not just re-check "can I configure?" It should check a small receipt for the last successful setup and only rerun if one of the inputs changed: app version, sandbox binary version, expected marker schema, or permissions state.
So the useful circuit breaker here is:
That tends to turn an infinite "set it up again" loop into either a stable no-op or one very obvious invalidation reason. We ended up caring a lot about that style of receipt + stop-reason boundary in MartinLoop, but the bigger fix here is really just making setup state durable and explainable.
I’m reporting a reproduced Windows Codex App sandbox setup/update loop that appears closely related to this issue.
Summary
Codex App repeatedly shows the banner/error:
However, the Windows sandbox setup log indicates that the sandbox setup itself completed successfully.
Environment
v0.139.0D:\Java-p\developer-workbenchRelevant symptoms
%USERPROFILE%\.codex\.sandbox%USERPROFILE%\.codex\.sandbox-bin%USERPROFILE%\.codex\.tmp%USERPROFILE%\.codex\tmp.sandboxand.sandbox-bin, but.sandbox-binwas empty.code=3221225477Failed to create shell snapshot for powershell: Shell snapshot not supported yet for PowerShell%USERPROFILE%\.codexstate remained.Sandbox log excerpt
setup_marker.json
Result / workaround
The issue was resolved only after deleting all Codex user-level residual files under
%USERPROFILE%\.codexand then reinstalling Codex. This suggests the App may be stuck on corrupted/stale user-level sandbox/app state even though the sandbox setup binary reports success.Suggested improvement
Please consider adding a UI action like “Reset local Codex state / Reset Agent Sandbox state” that safely clears stale sandbox/app state without requiring users to manually delete
%USERPROFILE%\.codexand lose sessions/configuration.The newer Windows reproduction makes this look less like a one-off installer failure and more like a missing failure-state contract around sandbox setup.
A useful diagnostic would be to persist one setup attempt record with:
retry_allowedandhalt_reasonIf the fingerprint and environment state are unchanged, Retry should stop re-running the same path and surface the captured record. That would also make reports from different Windows machines much easier to compare.