Skip to content

fix(codex): install global plugins through codex plugin add #253

Description

@corylanou

Problem

scripts/install-codex.sh --user currently writes Codex's private marketplace cache layout itself and then appends enabled plugin entries to ~/.codex/config.toml.

On Codex CLI 0.144.6, the supported installer publishes versioned roots through codex plugin add. The manual flow can expose an enabled plugin before the corresponding cache root is ready. On a first session after installation, both SessionStart and Stop from go-workflow@gopher-ai failed with exit code 127. The cache/config timestamps matched the session start, while a subsequent clean session succeeded.

The prior 1.7.1 active-root preservation fix prevents deleting an already-loaded root, but it still relies on Codex's private cache/config implementation and does not close this first-install race.

Proposed change

  • Require a Codex version that supports codex plugin add.
  • Register or upgrade the gopher-ai marketplace.
  • Install each Codex-capable plugin with codex plugin add <plugin>@gopher-ai.
  • Stop hand-writing cache roots and plugin enablement entries.
  • Make --prune-cache retain the current versioned root rather than a commit-hash root.
  • Update installer output and documentation to describe the public CLI flow.
  • Ship as a patch release so fleet machines can rerun the universal installer.

Acceptance criteria

  • --user invokes codex plugin add for all six Codex plugins.
  • The installer does not manually append [plugins.*] enabled = true entries.
  • A clean first Codex session reports no SessionStart or Stop hook exit-127 errors.
  • Reinstalling the same version does not invalidate an active plugin root.
  • Publishing a new version retains the prior root until explicit post-session pruning.
  • Existing installation, hook, and shared-sync tests pass.

Local implementation

A validated implementation is currently prepared on local branch fix/codex-plugin-cli-install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions