Scheduled automations on Windows cannot rewrite `.codex/browser/sessions` policy files, breaking Chrome/X skills that pass manually
Summary
On Windows, the same Codex workflow succeeds when run manually in a desktop thread, but fails when fired by a scheduled automation because the automation sandbox cannot rewrite Codex-managed browser session policy files under C:\Users\carlos\.codex\browser\sessions.
This breaks automations that rely on a required preflight step to clear stale denied origins before attaching to the real Chrome extension session.
Environment
- Codex Desktop:
0.133.0-alpha.1 - Platform: Windows
- Browser path used by workflow: real Chrome extension runtime
- Execution mode: scheduled cron automations
- Skill affected: local
x-reply-engagerworkflow using Chrome/X andwww.dostraders.com
What works
The exact same workflow works when run manually in a normal desktop thread, including:
- attaching to the real Chrome extension profile
- opening
https://x.com/home - verifying identity as
Carlos Mantilla / @mantillapb - opening
https://www.dostraders.com/ - publishing a real reply on X
So this does not look like a Chrome authentication problem or a site-specific problem.
What fails under scheduled automation
I reproduced this with two scheduler-fired smoke tests.
Smoke test 1
Observed in local files:
C:\Users\carlos\.codex\automations\x-reply-engager-smoketest\memory.mdC:\Users\carlos\.codex\sessions\2026\05\24\rollout-2026-05-24T20-25-33-019e5b05-3464-7883-b351-97928d45239c.jsonl
Behavior:
- automation was started by the scheduler
- preflight initially reported
remaining_deniedempty - later the run hit a denied browser-session policy file tied to the automation session id
- retry preflight failed with
UnauthorizedAccessExceptionwhile trying to write:
C:\Users\carlos\.codex\browser\sessions\019e5b05-3464-7883-b351-97928d45239c.toml
Smoke test 2
Observed in local files:
C:\Users\carlos\.codex\automations\x-reply-engager-smoketest-2\memory.mdC:\Users\carlos\.codex\sessions\2026\05\24\rollout-2026-05-24T20-35-32-019e5b0e-5a7b-7c41-b332-823d3165b474.jsonl
Behavior:
- automation was started by the scheduler
- run stopped before any Chrome/X work
- required preflight script failed immediately with:
UnauthorizedAccessException
Set-Content : Access to the path 'C:\Users\carlos\.codex\browser\sessions\019e5b05-3464-7883-b351-97928d45239c.toml' is denied.
Key finding
The scheduled automation session reports writable roots that do not include:
C:\Users\carlos\.codex\browser\sessionsC:\Users\carlos\.codex\skills\x-reply-engager
Even after explicitly adding those paths in the automation cwds, the effective automation sandbox still starts with writable roots limited to the automation folder, workspace, .git, and C:\tmp.
That means the required preflight cannot repair or normalize browser policy files in the place Codex itself stores them.
Why this looks like a Codex automation bug
- Manual on-demand execution succeeds.
- Scheduler-fired execution reproduces the failure.
- Failure occurs inside the automation sandbox / permissions model.
- The preflight script is required specifically to clear stale denied origins for the Chrome/X skill, but automation is denied write access to the folder it must modify.
Expected behavior
One of these should work:
- Scheduled automations should be allowed to rewrite Codex-managed browser session policy files when the workflow explicitly requires that preflight.
cwdsshould actually expand the effective writable roots to include those Codex-managed paths.- Codex should expose a first-class automation-safe policy repair API/mechanism so skills do not have to write
.codex/browser/sessions/*.tomldirectly.
Impact
- Scheduled
x-reply-engagerruns are not reliable. - The same task can succeed manually but fail in background automation.
- Automations may repeatedly fail and send blocker emails even though the browser/session is usable on demand.
Relevant local files
C:\Users\carlos\.codex\skills\x-reply-engager\scripts\x_browser_policy_preflight.ps1C:\Users\carlos\.codex\automations\x-reply-engager-smoketest\memory.mdC:\Users\carlos\.codex\automations\x-reply-engager-smoketest-2\memory.mdC:\Users\carlos\.codex\sessions\2026\05\24\rollout-2026-05-24T20-25-33-019e5b05-3464-7883-b351-97928d45239c.jsonlC:\Users\carlos\.codex\sessions\2026\05\24\rollout-2026-05-24T20-35-32-019e5b0e-5a7b-7c41-b332-823d3165b474.jsonl
If useful, I can also attach the exact automation prompts and the effective writable-root snippet from the rollout logs.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗