Skip to content

fix(codex): install local plugin cache during setup#3066

Open
Retengart wants to merge 2 commits into
thedotmack:mainfrom
Retengart:fix/codex-local-plugin-add
Open

fix(codex): install local plugin cache during setup#3066
Retengart wants to merge 2 commits into
thedotmack:mainfrom
Retengart:fix/codex-local-plugin-add

Conversation

@Retengart

Copy link
Copy Markdown

Summary

  • install the Codex plugin cache with codex plugin add claude-mem@claude-mem-local after registering the local marketplace
  • copy .install-version into the bundled marketplace plugin root before Codex installs from it
  • update the non-TTY install contract tests so local marketplace registration is not treated as a completed Codex install

Root cause

On current Codex CLI, codex plugin marketplace upgrade claude-mem-local is only valid for Git marketplaces. For a local marketplace it fails with:

marketplace `claude-mem-local` is not configured as a Git marketplace

The installer ran that command best-effort, so installs could still report Codex marketplace registration success while codex plugin list showed claude-mem@claude-mem-local as not installed and no active Codex plugin cache existed.

A second related gap is that Codex installs by copying from the bundled marketplace plugin root. That root did not receive .install-version, so a freshly installed Codex cache could inherit a missing marker and hit the runtime not yet set up SessionStart path even though runtime setup had completed elsewhere.

Related older report: #2361.

Verification

  • Reproduced locally on Codex CLI 0.142.2: worker readiness was healthy, marketplace was registered, but codex plugin list still showed not installed until codex plugin add claude-mem@claude-mem-local was run.
  • Verified local repair: codex plugin list shows installed, enabled; worker readiness returns ready; direct Codex hook replay returns accepted JSON for SessionStart, PreToolUse, and PostToolUse with no suppressOutput on tool hooks.
  • bun test tests/install-non-tty.test.ts tests/integration/codex-cli-installer.test.ts tests/setup-runtime.test.ts tests/services/integrations/spawn-contract-windows.test.ts
  • npm run typecheck:root
  • npm run build

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates Codex setup so the local plugin cache is installed during npx install. The main changes are:

  • Adds .install-version writing to the bundled marketplace plugin root.
  • Replaces the best-effort Codex marketplace upgrade with mandatory codex plugin add claude-mem@claude-mem-local.
  • Updates non-TTY install contract tests for local marketplace registration and Codex cache installation.

Confidence Score: 5/5

The changes are focused on Codex setup behavior and are covered by targeted installer and runtime tests.

No issues were identified in the reviewed changes, and the described verification includes relevant non-interactive install, integration, typecheck, and build coverage.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the base TREX harness to install Codex plugins, capturing the base run with TREX_TMP=/tmp/trex-codex/base and command traces that included codex --version, codex plugin marketplace add /tmp/trex-codex/base, and codex plugin marketplace upgrade claude-mem-local, with INSTALL_RETURN_CODE=0 and the stubbed invalid Git marketplace error handled as best-effort.
  • Executed the head harness against /tmp/trex-codex/head, reproducing the same command traces with codex --version, codex plugin marketplace add /tmp/trex-codex/head, and codex plugin add claude-mem@claude-mem-local, followed by 'Installed Codex plugin cache.' and INSTALL_RETURN_CODE=0.
  • Checked the runtime setup evidence and found that the after-markers log shows runtimeCacheMarker.exists=true, marketplacePluginMarker.exists=true, and freshCopiedCodexMarker.exists=true, with JSON marker content including version, Bun, uv, and installedAt.
  • Verified that the marketplace plugin marker is written during runtime setup itself, before the Codex copy/installation steps proceed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "fix(codex): fail when plugin cache insta..." | Re-trigger Greptile

Comment thread src/services/integrations/CodexCliInstaller.ts Outdated
@Retengart Retengart marked this pull request as ready for review June 26, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant