Repository navigation
Report a stale Codex plugin cache like a stale Claude Code one - #57
Merged
Merged
Conversation
Codex keeps no install record. `codex plugin add` copies the plugin to
<codex_home>/plugins/cache/<marketplace>/retroagent/<version>/, and Codex
loads the "local" folder if it is there, else the highest version. The
version is in the plugin.json of that folder. Before this change,
plugin_drift() read only Claude Code's installed_plugins.json. So
kb status, the SessionStart brief and auto_update did not see a stale
Codex copy.
- plugin_drift(cfg) now returns (clone, {agent: installed}) for each
agent that drifts. Codex counts only with codex on PATH, the same
condition that refresh_plugins uses. The marketplace is the one in
~/.agents/plugins/marketplace.json, as scripts/codex_marketplace.py
writes it.
- kb status prints one plugin line for each agent. The brief names each
agent that drifts. auto_update refreshes on Codex drift and names the
agent in its log line.
- New test builders: write_codex_plugin_cache and codex_on_path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Ps5Q2G4oefpsiSekaM7um
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
plugin_drift()read only~/.claude/plugins/installed_plugins.json. Codex also keeps a copy of the plugin for each version. For example, the Codex cache had 0.11.2 when the code clone had 0.11.4.kb status, the SessionStart brief andauto_updatedid not see the stale Codex copy.How Codex records the version
Codex keeps no install record. I read the Codex source (
codex-rs/core-plugin-common/src/installed.rs,core-plugins/src/store.rs):codex plugin add retroagent@<marketplace>copies the plugin to$CODEX_HOME/plugins/cache/<marketplace>/retroagent/<version>/. The folder name is theversionin.codex-plugin/plugin.json.localfolder if it is there, else the highest version.Change
codex_plugin_version(codex_home)finds the folder that Codex loads and reads the version from itsplugin.json. Alocalfolder without a version gives no drift, so no warning stays forever.~/.agents/plugins/marketplace.json(defaultpersonal), which is the marketplace thatrefresh_pluginsandinstall.shuse.codexis on PATH.refresh_pluginsuses the same condition, so kb reports only a drift that a refresh can fix.plugin_drift(cfg)returns(clone, {agent: installed}), or()when no agent drifts.kb statusprints oneplugin:line for each agent.auto_updaterefreshes on Codex drift. Its log line names the agent:plugin Codex 0.9.0 -> 1.0.0.installed_plugin_versionhas the new nameclaude_plugin_version.troubleshooting.mdx,commands.mdx,installation.mdxandconfiguration.mdxnow include Codex.write_codex_plugin_cacheandcodex_on_pathintests/fixtures.py. All tests stay off the real HOME.src/changes only, so the plugin version does not change.Verification
/simplifyand/code-review: I applied the fixes. I did not apply the findings that change behavior or that were already true before this change.scripts/test --all: 1721 passed, 13 skipped./verifyin a sandbox, with a fakecodexon PATH:codex→ no line;codex→plugin: WARNING Codex loads retroagent 0.11.2, the code clone has 0.11.4 …, and the brief line;plugin: Codex loads retroagent 0.11.4, and no brief line.additionalContext.This container has no real
~/.codexand no Codex CLI, so I did not test against a real Codex install.🤖 Generated with Claude Code
https://claude.ai/code/session_019Ps5Q2G4oefpsiSekaM7um
Generated by Claude Code