Windows Codex Desktop persists volatile plugin cache hash paths in sessions, causing older threads to lose skills after plugin cache updates
Summary
Codex Desktop on Windows appears to persist absolute SKILL.md paths under volatile plugin cache hash directories into long-lived session context. After the plugin cache updates and the previous hash directory is removed, older or running sessions can fail to load skills, repeatedly report that skills are missing, and reconnect several times before failing.
This does not appear to be user-authored configuration. The affected paths are generated/injected by Codex as part of the available-skills/session context.
Environment
- OS: Windows
- Product: Codex Desktop
- Plugin family observed:
openai-curated/superpowers,openai-curated/figma, andopenai-bundled/browser - Current observed real Superpowers/Figma cache hash:
fef63ecf - Previous observed bridge target hash:
acdd3141 - Older session paths observed:
719ed655,9b3c8689 - Example failed stream request ID shown by the app:
a544bbba-7fb9-4e58-937c-927e0f7a617a
Symptoms
- Older sessions say skills such as
subagent-driven-developmentcannot be found. - Sessions repeatedly show reconnect messages before eventually failing.
- The skill files still exist under the latest cache hash, but old session paths point to removed hash directories.
- Recreating compatibility junctions from old hash paths to the current hash immediately restores
SKILL.mdreads.
Evidence
Representative path from an older session, redacted:
C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\719ed655\skills\subagent-driven-development\SKILL.md
Before the local workaround, old session paths were stale:
Test-Path "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\719ed655\skills\subagent-driven-development\SKILL.md"
# False
Test-Path "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\9b3c8689\skills\subagent-driven-development\SKILL.md"
# False
The same skill existed under the current real plugin cache hash:
Test-Path "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\fef63ecf\skills\subagent-driven-development\SKILL.md"
# True
Test-Path "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\fef63ecf\skills\systematic-debugging\SKILL.md"
# True
After creating local compatibility junctions, old paths immediately became readable again:
# Examples of non-destructive compatibility junctions created locally:
# superpowers\acdd3141 -> superpowers\fef63ecf
# figma\acdd3141 -> figma\fef63ecf
# browser\26.519.81530 -> browser\26.527.30818
Test-Path "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\719ed655\skills\subagent-driven-development\SKILL.md"
# True
Get-Content "C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\719ed655\skills\subagent-driven-development\SKILL.md" -TotalCount 3
# ---
# name: subagent-driven-development
# description: Use when executing implementation plans with independent tasks in the current session
This suggests the underlying skills were not removed. The persisted cache-hash path became stale.
Expected behavior
Durable session state should persist stable skill references, not absolute paths under volatile plugin cache hashes.
For example, session state could store a semantic reference such as:
skill://openai-curated/superpowers/subagent-driven-development
or structured data such as:
{
"source": "openai-curated",
"plugin": "superpowers",
"skill": "subagent-driven-development"
}
On resume or turn start, Codex should resolve that reference through the current plugin registry.
Actual behavior
Older sessions appear to retain paths like:
C:\Users\<redacted>\.codex\plugins\cache\openai-curated\superpowers\<hash>\skills\<skill>\SKILL.md
When <hash> changes and the old cache directory is removed, session skill loading breaks even though the skill exists under the current cache hash.
Suggested fix
- Do not serialize plugin cache hash paths into session/system context.
- Store stable semantic skill references instead.
- Regenerate the available-skills list from the current plugin registry when resuming a thread.
- Add a persistence guard that rejects or rewrites paths matching
.codex\plugins\cache\...\<hash>\skills\...before they enter durable session state. - Optionally maintain a stable per-plugin
currentpointer as a compatibility layer for file-path consumers.
Additional notes
The local junction workaround confirms this is path-staleness rather than skill deletion, but it is not a durable product fix because plugin cache hashes can change again on update.
9 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I prepared a fix branch here:
https://github.com/lengmingz/codex/tree/fix/plugin-cache-retain-superseded-skill-paths
Compare URL:
https://github.com/openai/codex/compare/main...lengmingz:codex:fix/plugin-cache-retain-superseded-skill-paths
Commit:
889e25c Keep old plugin cache versions readableApproach:
SKILL.mdpaths.active-versionmarker so the active plugin version is explicit instead of inferred from retained version directory namesI tried to open a PR from the fork, but GitHub rejected both
gh pr createand the API call with permission errors from this account/session. Local tests were not run because this Windows environment does not havecargo,rustc,just, orbazelon PATH.I pushed a proposed fix branch here after local verification:
Summary of the proposed fix:
.active-versionmarker so the current version remains unambiguous while oldlocal/hash directories are retained.Local verification on Windows:
just fmtjust test -p codex-core-plugins(190 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; reported an existingmanifest.rslarge_enum_variant warning)I attempted to open the upstream PR from this fork branch via both
gh pr createand the GitHub connector, but GitHub rejected the create-pull-request API call with permission errors (CreatePullRequest/Resource not accessible by integration). The branch is available at the compare link above.Update after reviewing #24390, especially the cache-invalidation analysis in https://github.com/openai/codex/issues/24390#issuecomment-4577771198:
I updated the proposed fix branch to address both layers of the problem:
Changes now included:
.active-versionmarker so the active version is explicit while older cache-version dirs remain readable.PluginsManager's cachedPluginLoadOutcomekey, not just the effective config TOML version.plugins_for_configfrom returning staleeffective_plugin_skill_rootsafter the active plugin cache version changes under the same config.1.0.0, updates the active cache version to2.0.0without clearing the manager cache, then verifies the nextplugins_for_configcall returns the2.0.0skill root..active-versionselection.Local verification on Windows:
just fmtjust test -p codex-core-plugins(191 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; reported an existingmanifest.rslarge_enum_variantwarning)I retried PR creation after this update, but GitHub still rejects this account/session's API call with:
The compare link above should be ready for a maintainer to open or cherry-pick.
Additional handoff artifact: since GitHub still rejects creating the upstream PR from this account/session, I opened a fork-local mirror PR so the patch has a stable PR-style diff/review page:
The mirror PR is draft and exists only as a review/handoff artifact; it targets the same commit described above and verified with:
just fmtjust test -p codex-core-plugins(191 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; existingmanifest.rslarge_enum_variantwarning only)Update: the fork-local mirror PR is now marked ready for review (no longer draft):
It still targets the same verified commit:
6c2c94daf4026f526465cc4d974348091fb45488.Maintenance update: rebased the handoff branch onto current
openai/codex@mainafter #25318 landed.Fresh verification after rebase:
just fmtjust test -p codex-core-plugins(191 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; existingmanifest.rslarge_enum_variantwarning only)Maintenance update: rebased the handoff branch onto current
openai/codex@main(3b7334d099b339e7b18418a0cf7ac34e7bed2e43).Fresh Windows verification after rebase:
just fmtjust test -p codex-core-plugins(191 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; existingcore-plugins/src/manifest.rslarge_enum_variantwarning only)I retried creating the upstream PR, but GitHub still rejects this account/session with
CreatePullRequestpermission errors.Maintenance update: rebased the handoff branch onto current
openai/codex@main(9756316d89968945212cd5f958b2b972c77c9e09) after upstream touchedcore-plugins/src/manager_tests.rs.Fresh Windows verification after rebase:
just fmtjust test -p codex-core-plugins(192 passed; bench smoke compiled and started)just fix -p codex-core-plugins(passed; existingcore-plugins/src/manifest.rslarge_enum_variantwarning only)I retried creating the upstream PR, but GitHub still rejects this account/session with
CreatePullRequestpermission errors.