Feature: provenance-aware Codex CLI update manager
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with the existing contracts referenced by #356, #2519, #2382, and #2632, then inspect the entry points represented by ocx system codex-cli-update check, dry-run, apply, and status. Use the listed acceptance scenarios to define coverage for provenance, process blockers, deterministic plans, stale-plan rejection, and post-install readback; done requires the focused provenance, apply, dashboard, and documentation changes.
Written by the indexing model from the issue text.
Description
Area
Multiple areas
What are you trying to accomplish?
OpenCodex already detects the Codex runtime it uses, restores an established shim after a supported external update, and can identify long-lived app-server processes. It does not yet provide one safe workflow for checking and updating the independently installed Codex CLI that OpenCodex is actually integrating with.
The desired workflow is an explicit, provenance-aware Codex CLI update manager. It should tell the operator which selected CLI installation is manageable, which installation channel owns it, whether an update can proceed without disrupting an active Codex session, and what exact version would be installed before any mutation occurs.
What prevents this today?
Codex can coexist in several independent forms on one host: an npm global installation, a native app bundle, a standalone installer, or a version-manager-owned tree. A path and codex --version result are not enough to decide which installer owns that runtime or whether OpenCodex may safely replace it.
Operators currently have to combine separate manual steps:
- determine which
codexruntime OpenCodex selected; - infer how that runtime was installed;
- check whether an interactive CLI, app-server, or code-mode host still uses it;
- run the matching installer;
- restore and verify the OpenCodex shim when applicable; and
- read the actual runtime back instead of trusting an installer exit code.
This is error-prone when an app-bundled CLI and an independently installed CLI coexist. It is also unsafe to generalize the existing OpenCodex self-update worker to Codex: the two packages have different ownership, process, and rollback boundaries.
What should OpenCodex do?
Provide a separate, explicitly invoked Codex CLI update workflow with these phases:
-
Inspect and dry-run
- Resolve the exact selected Codex runtime.
- Classify its installation provenance from direct package or installer evidence.
- Report current version, update channel, redacted canonical location, shim state, and active or unknown process blockers.
- Produce a deterministic plan without writing files, changing configuration, or starting an installer.
-
Explicit apply
- Require an operator-confirmed plan ID.
- Revalidate runtime identity, installation provenance, current version and hash, target version and integrity, and process blockers immediately before applying.
- Install one exact resolved version through the verified owner channel.
- Read back the selected runtime and restore the existing shim only when that installation had an eligible shim before the update.
- Classify the result from readback as applied, not applied, ambiguous, or applied with shim repair still required.
-
Dashboard integration
- Present Codex CLI updates separately from OpenCodex updates.
- Keep Apply disabled until the operator has reviewed the dry-run plan and confirmed that only the selected independent CLI will be changed.
Safety requirements:
- Native app, Store/MSIX, and app-bundled Codex binaries are always non-managed.
- Version-manager-owned and otherwise unverified installations are non-managed; OpenCodex must not adopt or rewrite them.
- An active matching Codex session defers the update. Unknown process identity or failed enumeration also defers it.
- OpenCodex must not terminate or restart Codex, the native app, app-server, code-mode host, proxy, or tray as part of this workflow.
latestis resolved before apply and the exact version plus registry integrity or installer digest is bound into the plan.- A stale plan is rejected rather than silently regenerated.
- Ambiguous post-install state is not retried or rolled back automatically.
- No app-bundle copying or manual restoration of a package tree is used as rollback.
The implementation should remain reviewable as three focused changes: provenance and dry-run; apply engine and CLI/management API; dashboard and documentation.
Example usage or interface
ocx system codex-cli-update check --json
ocx system codex-cli-update dry-run --channel latest --json
ocx system codex-cli-update apply --plan-id <id> --yes --json
ocx system codex-cli-update status <job-id> --json
Example non-managed result:
{
"selectedVersion": "0.149.0",
"provenance": "app-bundle",
"managed": false,
"reason": "app_bundle",
"installerCommand": null
}
Example deferred result:
{
"managed": true,
"status": "deferred",
"reason": "active_codex_session",
"installerStarted": false
}
Alternatives or workarounds
- Running the installation command manually and then
ocx ensureworks when the operator already knows the owning channel and no Codex process is using that installation. It does not provide a bound plan or post-readback classification. - A scheduler or cross-host updater would add a second orchestration problem before the single-host operation is safe. This proposal deliberately leaves scheduling and multi-host coordination out of scope.
- Updating the native desktop app remains the app platform's responsibility.
Additional context
This proposal builds on, rather than duplicates, existing contracts:
- #356 restores an established OpenCodex shim after a supported external npm update.
- #2519 refuses to adopt version-manager-owned Codex installations and provides actionable diagnostics.
- #2382 keeps desktop-app restart an explicit opt-in operation.
- #2632 fails closed when the OpenCodex package tree changes under a live process.
Acceptance tests should cover npm shim-to-backing provenance, simultaneous PATH candidates, app bundles, version-manager layouts, unverified standalone installs, active and unknown process identity, PID reuse, a dry run with zero writes and zero installer spawns, deterministic plan identity, stale-plan rejection, and post-install readback taking precedence over exit status.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 4h 24m
- Merged PRs (30d)
- 574
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from lidge-jun/opencodex
-
添加全局代理功能Openenhancement proxy
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
bug tools
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement proxy
Difficulty 4/5 3-5 days Newbie friendliness 48/100
lidge-jun/opencodex#6604 · 1 comment ·
Maintainers usually reply within 1 day
-
bug cli platform service
Difficulty 3/5 1-2 days Newbie friendliness 65/100
lidge-jun/opencodex#6575 · 2 comments ·
Maintainers usually reply within 1 day
-
bug proxy
Difficulty 5/5 Over a week Newbie friendliness 35/100
lidge-jun/opencodex#6568 · 3 comments ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
solana-foundation/solana-com#2245 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`document.cookie` with `max-age=0` does not delete the cookiePossibly taken @BartInTheField claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
capricorn86/happy-dom#2460 ·
Maintainers usually reply within 2 days