[Windows Desktop] Stale CODEX_SQLITE_HOME and CODEX_INSTALL_DIR are injected into every new task after user variables are removed
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
Codex Desktop on Windows continues to inject historical E: drive paths into every newly created task process, even though the corresponding user-level and machine-level environment variables have been removed.
This behavior persists after a full Windows restart and after uninstalling/reinstalling Codex. It occurs alongside recurring conversation archive failures and occasional thread not found errors.
Environment
- Codex Desktop MSIX:
26.814.5167.0 - Windows x64 build:
26200.9168 - Host: local Windows
Historical configuration
The following user environment variables were previously configured:
CODEX_HOME=E:\codex\state
CODEX_SQLITE_HOME=E:\codex\state\sqlite
CODEX_INSTALL_DIR=E:\codex\bin
They have since been removed. Read-only checks now show all three variables unset at both User and Machine scope.
Actual behavior
In every newly started Codex task process:
CODEX_HOME=<unset>
CODEX_SQLITE_HOME=E:\codex\state\sqlite
CODEX_INSTALL_DIR=E:\codex\bin
The E: paths therefore reappear at Process scope despite no longer existing at User or Machine scope. Codex also recreates state beneath the historical E: location.
Associated archive failures include:
failed to archive session: thread-store internal error:
failed to archive thread: The system cannot find the file specified. (os error 2)
After some failed archive attempts, continuing the conversation returns:
thread not found: <thread-id>
Restarting the desktop app can temporarily make the conversation usable again, but does not eliminate the injected paths or reliably fix archiving.
Verification and troubleshooting already performed
- Removed the three variables from User scope.
- Confirmed the variables are unset at User and Machine scope.
- Fully restarted Windows.
- Repeated the check in newly created Codex tasks.
- Uninstalled and reinstalled Codex more than once.
- Performed a reversible isolation/reset of Codex-only runtime, cache, global-state, and historical E: state.
- Restored the original state after the isolation test.
- No non-Codex application files or Windows-wide settings were modified.
- The Process-scope E: injection remained reproducible.
Local diagnostics recorded multiple archive failures across different conversation IDs, subsequent thread not found events, and repeated bundled_executable_relocation_failed warnings. Raw logs, databases, authentication files, personal paths, and conversation contents are intentionally not attached.
Expected behavior
After the user-level variables are removed and Windows is restarted:
- New Codex processes should not receive the historical E: paths.
- Codex should use its supported default locations on C:.
- Uninstalling/reinstalling should not preserve an undocumented per-process injection source.
- Archiving should not leave a thread temporarily unresolvable.
Request
Please investigate where Codex Desktop persists or reconstructs CODEX_SQLITE_HOME and CODEX_INSTALL_DIR for newly spawned task processes on Windows.
A supported way to reset these internal path overrides to the default locations would also be helpful.
Potentially related archive reports:
- #39161
- #39179
- #39130
In-app feedback ID: 01a01546-426d-7b41-ab8b-5375653dc37e
I can provide targeted, sanitized diagnostic excerpts if maintainers identify the specific fields needed.
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.
Research direction
No source file or test is named. Start by tracing how Windows task processes receive CODEX_SQLITE_HOME and CODEX_INSTALL_DIR and how Codex persists or reconstructs those values, then inspect the related archive and thread-store behavior. Done means removed variables are not injected, default locations are used, and archiving does not leave threads temporarily unresolvable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases, desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100