Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex Desktop MSIX 26.825.6671.0
What platform is your computer?
Windows 11 Pro, version 10.0.26200, build 26200, x64
What issue are you seeing?
In a Windows-native Codex Desktop task, commands executed by the agent silently see a package-private MSIX copy of %APPDATA% instead of the user's real profile data.
This happens with the Codex sandbox fully disabled:
approval_policy = "never"
sandbox_mode = "danger-full-access"For example, an agent command opening this textual path:
C:\Users\<user>\AppData\Roaming\netlify\Config\config.json
actually opens this file according to GetFinalPathNameByHandle:
\\?\C:\Users\<user>\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\netlify\Config\config.json
The two files are different:
Real user profile file SHA-256:
073a2440c1f66fa4848f4490b37da409dca5fb76b82202ea0ae07e27b94059c7
Package-private LocalCache file SHA-256:
81acac35e22045db93ec5c512015623782c8fcf04b5f19b4a894c6e9d2867c54
A normal unpackaged Windows terminal sees the real file. Codex agent exec in Windows-native mode sees the package-private file. This is not an environment-variable mismatch: %APPDATA% contains the expected textual path in both processes. The redirection occurs when the path is opened.
The package-private profile already contains shadows for multiple unrelated programs, not just the CLI used in this example. This can silently split configuration, authentication state, caches, and application data between normal user processes and Codex agent commands.
The Codex exec process reported:
GetCurrentPackageFullName: no package identity
IsAppContainer: false
Token virtualization enabled: false
Despite that, the opened path was redirected into the Codex package's LocalCache.
What steps can reproduce the bug?
- Install Codex Desktop from the Microsoft Store/MSIX package.
- Select Windows native as the agent environment.
- Configure
sandbox_mode = "danger-full-access"and start a new task. - From a normal unpackaged Windows terminal, create an application config under
%APPDATA%or use an existing CLI that stores authentication/configuration there. - Run that CLI from a Codex agent command, causing it to access the same
%APPDATA%path. - Compare the file seen by the normal terminal and the file seen by Codex agent exec.
- For definitive evidence, open the file in the Codex exec process and call
GetFinalPathNameByHandleon its handle. - Observe that the Codex command opens
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\...while the normal terminal opens the actual%APPDATA%\...file.
A deterministic variant is:
- From an unpackaged terminal, write a marker file under
%APPDATA%\codex-msix-repro\probe.txt. - From Codex agent exec, write a different value to the same textual path.
- Compare the file from the unpackaged terminal and Codex exec.
- Inspect the final opened path from Codex exec.
What is the expected behavior?
In Windows-native mode with danger-full-access, agent commands should operate on the same user profile and application configuration as commands launched from the user's normal Windows terminal.
At minimum, Codex must not silently present a second private %APPDATA% tree while reporting the normal user path in environment variables. If isolation is intentional, it should be explicit, documented, and controllable.
Actual behavior and impact
- Existing CLI authentication appears to be missing inside Codex.
- Logging in from Codex can create a second credential/configuration state that normal terminals do not see.
- Programs can read and write stale or divergent settings without any visible path difference.
- Disabling the Codex sandbox does not fix the behavior because this is MSIX filesystem virtualization, not the Codex sandbox.
- The integrated terminal can behave differently from agent exec even within the same Codex Desktop window.
This makes Windows-native agent execution unreliable for any tool using %APPDATA% or %LOCALAPPDATA%.
Additional information
Microsoft documents that packaged desktop apps can redirect writes under AppData into a per-user, per-package location. Package authors can disable filesystem write virtualization in the package manifest. Codex Desktop should either disable this virtualization for agent execution or spawn agent commands through an unpackaged broker that sees the real user profile.
Related but distinct issues:
- Windows regression: explicit Git Bash
exec_command.shellfalls back tocmd.exe#40328 — an explicit Git Bashexec_command.shellcan be discarded/fall back to another shell. This blocks using Git Bash as a reliable workaround, but it is not the AppData redirection itself. - Windows: allow configuring the default session shell via config #16579 — request to configure the default Windows session shell. This also does not address MSIX profile virtualization.
The issue was reproduced in a fresh Codex task. No credential contents or tokens are included in this report.
Activity
github-actions commentedon Aug 30, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
kamkie commentedon Aug 30, 2026
Thanks. I reviewed #41307; this is not a duplicate.
#41307 reports several Codex Desktop UI problems: the app's own ChatGPT/OAuth session being lost, an OAuth loop, off-screen window bounds, and BOM parsing of Codex state. It speculates about synchronization between Codex authentication locations, but it does not reproduce agent
execopening arbitrary third-party application data through MSIX filesystem virtualization.#41665 is narrower and has a different reproduction and impact:
sandbox_mode = "danger-full-access"andapproval_policy = "never".%APPDATA%reports the normal textual user path, butGetFinalPathNameByHandleproves that the opened file is under the Codex package'sLocalCache\Roamingtree.%APPDATA%location.exec, even when Codex Desktop authentication is working normally.The overlap is that both reports mention the Codex MSIX
LocalCache. #41307 may describe one possible downstream symptom, but it does not cover the agent-execution filesystem redirection reported here. I am therefore keeping #41665 open as the minimal reproduction for theexec/MSIX virtualization issue.kamkie commentedon Aug 30, 2026
Thanks — this narrowing was decisive. I inspected the installed manifest for
OpenAI.Codex_26.825.6671.0_x64__2p2nqsd0c76g0on Windows 11 build26200.The package declares the older package-wide settings and capability:
However, it also declares the Windows 11 granular form:
The manifest has no corresponding exclusion for
RoamingAppData\netlifyor arbitrary third-party CLI configuration locations. Microsoft documents that the Windows 11 declarations take precedence over the older declarations when both are present. That matches the observation exactly:%LOCALAPPDATA%\OpenAIis explicitly unvirtualized, while%APPDATA%\netlifyresolves private-first to the Codex package'sLocalCache\Roamingtree.This means the cause on this installation is not simply a missing
unvirtualizedResourcescapability or missing package-widedisabledsetting. Both are present. The effective Windows 11 policy is narrowed by the granular declaration to the OpenAI LocalAppData subtree.I also tested launching the registered package's
app\ChatGPT.exedirectly from itsWindowsAppsinstallation path, after closing the existing app. The new process was created directly, but agentexecstill opened the Netlify file fromLocalCache\Roaming, so that simple direct-launch workaround did not change the effective filesystem view.The remaining launch-boundary question you identified is still important: the exec child reports no package identity, yet receives the package-private view. But the installed manifest now explains why the package context has this specific AppData policy once that context reaches the child.
For terminal-equivalent execution of arbitrary third-party tools, an unpackaged/breakaway execution broker still appears semantically narrower than globally disabling isolation for the entire Desktop app. Alternatively, the package would need an effective unvirtualized policy covering arbitrary agent CLI paths rather than only
LocalAppData\OpenAI.kamkie commentedon Aug 30, 2026
Scope clarification: this report concerns the distributed Codex Desktop app for Windows. The Desktop application code and Store/MSIX packaging manifest do not appear to be present in this repository. I am reporting it in
openai/codexbecause this is the public tracker used for Codex Desktop bugs as well, including issues carrying theappandwindows-oslabels.kamkie commentedon Aug 30, 2026
Thanks — that boundary matches the local process evidence, and I now have a stronger identity probe than the earlier AUMID result.
The observed process chain is:
codex.exeitself is loaded from%LOCALAPPDATA%\OpenAI\Codex\bin\..., outsideWindowsApps. In the currentpwsh.exechild, both native package APIs return15700(APPMODEL_ERROR_NO_PACKAGE):So this is stronger than
GetApplicationUserModelId -> NO_APPLICATION: the shell child has no package identity visible through the package identity APIs. Nevertheless, opening the textual path:and resolving the opened handle with
GetFinalPathNameByHandleyields:This reproduces with
danger-full-accessand approvals disabled. In other words, the ordinary third-party child exposes no package identity, yet it still receives the package-private AppData filesystem view.That seems to support your placement of the discriminating boundary above
spawn_child_async, around the packaged Desktop process launchingcodex.exe app-serveror another inherited runtime/compatibility context. A unit test of the generic spawn function outside the distributed MSIX would indeed miss the decisive condition; this needs a Desktop/MSIX integration probe.kamkie commentedon Aug 31, 2026
I ran the descendant-side version of that discriminator locally.
The test created a PowerShell broker with
CreateProcessW+STARTUPINFOEX, setting:The setup itself succeeded:
InitializeProcThreadAttributeList,UpdateProcThreadAttribute, andCreateProcessWall returned success. A smoke child deliberately exiting with code42was created and observed correctly, so the attribute-bearing launch path was active.I then compared two disposable probes of the same textual path:
pwsh.exe.BREAKAWAY_ENABLE_PROCESS_TREE.Each probe opened the file and classified the result from
GetFinalPathNameByHandle. The result was:Both resolved to the package-private
OpenAI.Codex...\LocalCache\Roamingview.So applying
BREAKAWAY_ENABLE_PROCESS_TREEfrom inside the already affectedpwsh.exesubtree does not provide an escape hatch on this installation. This does not falsifyDESKTOP_APP_POLICYas the mechanism at the original packagedChatGPT.exe-> externalcodex.exe app-serverboundary: the policy may need to be controlled at that launch, or another packaging/runtime mechanism may already be decisive by the time the descendant runs.The remaining useful discriminator is therefore still the distributed Desktop harness test at the original app-server creation boundary. The descendant result narrows the expectation: changing this attribute only after the app-server tree exists is insufficient.
arussin commentedon Oct 1, 2026
I reproduced this with Wrangler 4.144.0 and verified a narrow workaround, including a check from a fresh Codex task.
Both processes reported the same normal Windows user and the same apparent AppData path. A metadata-only GetFinalPathNameByHandle probe showed two different files:
For this specific stale-shadow case, the working sequence was:
The existing login successfully refreshed without another login. A separate fresh Codex task then passed whoami with the same limited scopes, resolved the real file, and left the shadow absent. No token contents were read/copied, and no ACLs, sandbox settings, or OAuth grants were changed.
Important boundary: the sandbox identity itself was denied access to the real file. Our initial sandbox-based verification was stopped and rolled back. The successful sequence kept credential use entirely in the approved normal-owner context; it does not make sandbox credential access work.
Scope and caution: this is a tested workaround for one existing plaintext Wrangler store, not a general MSIX fix. Reboot/upgrade behavior and future login/profile creation are untested. Later creation of a private shadow could reintroduce divergence. A same-directory rename can be reversed before authentication activity, but a subsequent OAuth refresh/token rotation is not undone by restoring an old backup. Never overwrite a newly created credential file or automatically restore stale credentials after refreshing.
Microsoft's documented private-first/fallback behavior is consistent with the result: https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes#common-file-system-operations
immanuelgiulea commentedon Oct 16, 2026
Is there any update on this?
Codex moved my rclone.conf out of AppData\Roaming\rclone into AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\rclone!
I wasted over 6 hours running file recovery with winfr thinking the file was deleting.
please fix this bug. thank you.
jeonghakhui-art commentedon Oct 28, 2026
Additional reproduction of the same MSIX AppData path divergence, this time under
AppData\\Local(rather thanRoaming).On 2026-10-28, a Codex/Work task was asked to create an empty JSON credential-store placeholder, with no real API keys or tokens, in a user-local path:
What happened:
The agent reported successful creation, an 18-byte file, and ACLs limited to the current user and SYSTEM. It initially characterized this as installed on the user's real Windows profile.
In a separate, ordinary interactive Windows PowerShell session on the same PC/account,
Test-Path -LiteralPathfor that exact logical path returned False (retested).The agent subsequently used a Windows file handle and
GetFinalPathNameByHandleto identify the actual resolved path:The user independently located the 18-byte file at that
LocalCache\\Locallocation in Explorer.The agent withdrew its earlier "installed in the real user profile" completion claim. A host-visible file at the requested logical path, and a shared file view between Work and normal PowerShell, were not verified.
Why this matters: when an agent creates and checks a configuration/credential file entirely within its own virtualized view, both operations can appear successful, even though an unpackaged user process sees no file at the requested path. The misleading task-completion report is an additional user-facing impact beyond the underlying path redirection.
No real keys or credentials were populated, and no exfiltration is alleged. Paths above are redacted; the desktop app build was not independently captured. This is a reproduction report, not a claimed fix. It would help if the agent/runtime could detect or explicitly disclose the effective opened path when it differs from the requested user-profile location.
icebergvl commentedon Nov 15, 2026
Additional reproduction of the same AppData split with an unrelated Windows CLI, Hermes Agent v0.23.1 stable, on Windows 11.
C:\Users\<user>\AppData\Local\hermes\bin\hermes.exe --versionreportsInstall directory: C:\Users\<user>\AppData\Local\hermes\hermes-agent. Hermes also opens its user profile there and a local test session persists after exit.Install directory: C:\Users\<user>\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\hermes\hermes-agent.Is there a supported way for a Codex Desktop agent task to execute this external CLI against the real user AppData tree without changing the sandbox policy or moving either installation? If there is no supported Desktop route, is the standalone Codex CLI launched from an ordinary Windows terminal the recommended workaround? The current status of any shipped fix would also help.