feat(codex): install via curl script instead of npm#2758
Conversation
Codex was the only shell-installable provider still defaulting to `npm install -g @openai/codex`. OpenAI ships an official install script (the same one referenced by the existing Windows PowerShell installer), so make curl the recommended method on macOS/Linux for consistency with claude, grok, droid, and the other curl-based providers. npm and the homebrew cask remain as fallback options, and updates still resolve through the npm release source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR changes the Codex CLI install recommendation from
Confidence Score: 4/5The install-method change is straightforward and the curl URL mirrors the existing Windows PowerShell installer already in the codebase. The uninstall path for curl-installed users is broken but does not affect installation, update, or normal usage. The curl and npm fallback install options are correctly structured. However, packages/plugins/src/agents/impl/codex/index.ts — the uninstall declaration needs attention; apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts is fine.
|
| Filename | Overview |
|---|---|
| packages/plugins/src/agents/impl/codex/index.ts | Migrates hostDependency from npmDependency() helper to an explicit curl-first descriptor mirroring grok, but carries over uninstall: { kind: 'package-manager' } without an uninstallCommand on the curl option, leaving curl-installed users with a broken uninstall path |
| apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts | Single-line update to flat installCommand metadata string from npm to curl — consistent with the plugin change |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User triggers Uninstall for Codex] --> B{Detect install method}
B -->|method = curl recommended path| C[Look up curl InstallOption]
C --> D{uninstallCommand present?}
D -->|No — missing on curl option| E[resolveUpdatePlan returns kind: none]
E --> F[Runtime returns err: no-uninstall-command]
F --> G[UI shows error to user]
B -->|method = npm fallback path| H[Look up npm InstallOption]
H --> I{uninstallCommand present?}
I -->|Yes: npm uninstall -g @openai/codex| J[Run uninstall command]
J --> K[Uninstall succeeds]
B -->|method = undefined no prior probe| L[Fall back to recommended = curl]
L --> D
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User triggers Uninstall for Codex] --> B{Detect install method}
B -->|method = curl recommended path| C[Look up curl InstallOption]
C --> D{uninstallCommand present?}
D -->|No — missing on curl option| E[resolveUpdatePlan returns kind: none]
E --> F[Runtime returns err: no-uninstall-command]
F --> G[UI shows error to user]
B -->|method = npm fallback path| H[Look up npm InstallOption]
H --> I{uninstallCommand present?}
I -->|Yes: npm uninstall -g @openai/codex| J[Run uninstall command]
J --> K[Uninstall succeeds]
B -->|method = undefined no prior probe| L[Fall back to recommended = curl]
L --> D
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/plugins/src/agents/impl/codex/index.ts:117-119
**Uninstall declared but broken for the recommended curl install path**
`uninstall: { kind: 'package-manager' }` tells the runtime to run the `uninstallCommand` for whichever method was used to install. The `curl` option (the recommended one) has no `uninstallCommand`, so any user who installed via curl will see an "Uninstall" button in the UI but get a `no-uninstall-command` runtime error when they click it (`host-dependency-manager.ts` line 851). The `grok` plugin — which follows the same curl-first pattern — avoids this by omitting the `uninstall` field entirely, which signals "uninstall not supported" and hides the UI button altogether.
Reviews (1): Last reviewed commit: "feat(codex): install via curl script ins..." | Re-trigger Greptile
| uninstall: { | ||
| kind: 'package-manager', | ||
| }, |
There was a problem hiding this comment.
Uninstall declared but broken for the recommended curl install path
uninstall: { kind: 'package-manager' } tells the runtime to run the uninstallCommand for whichever method was used to install. The curl option (the recommended one) has no uninstallCommand, so any user who installed via curl will see an "Uninstall" button in the UI but get a no-uninstall-command runtime error when they click it (host-dependency-manager.ts line 851). The grok plugin — which follows the same curl-first pattern — avoids this by omitting the uninstall field entirely, which signals "uninstall not supported" and hides the UI button altogether.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/plugins/src/agents/impl/codex/index.ts
Line: 117-119
Comment:
**Uninstall declared but broken for the recommended curl install path**
`uninstall: { kind: 'package-manager' }` tells the runtime to run the `uninstallCommand` for whichever method was used to install. The `curl` option (the recommended one) has no `uninstallCommand`, so any user who installed via curl will see an "Uninstall" button in the UI but get a `no-uninstall-command` runtime error when they click it (`host-dependency-manager.ts` line 851). The `grok` plugin — which follows the same curl-first pattern — avoids this by omitting the `uninstall` field entirely, which signals "uninstall not supported" and hides the UI button altogether.
How can I resolve this? If you propose a fix, please make it concise.|
Thanks for your interest in contributing, @hetdv - back with proper feedback soon! |
Summary
Codex was the only shell-installable provider still defaulting to
npm install -g @openai/codex. OpenAI ships an official install script — the same one already referenced by the existing Windows PowerShell installer (chatgpt.com/codex/install.ps1) — so this makes curl the recommended install method on macOS/Linux, consistent withclaude,grok,droid, and the other curl-based providers.Changes
packages/plugins/src/agents/impl/codex/index.ts— replaced thenpmDependency(...)helper with an explicithostDependencydescriptor (mirroring thegrokpattern):curl -fsSL https://chatgpt.com/codex/install.sh | sh(recommended), withnpmand the homebrew cask kept as fallbacksnpmfallbackupdatescontinue to resolve through the npm release source (@openai/codex)apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts— updated the flatinstallCommandmetadata string to the curl command.Checks run
@emdash/pluginstypecheck ✅ and tests ✅ (101 passed, incl. the generic install-command validation suite)@emdash/emdash-desktoptypecheck ✅@emdash/corehost-dependencies tests ✅ (80 passed)dependenciestests ✅ (34 passed; theinstall-runnersuite was skipped locally only because Electron's binary wasn't downloaded in this sandbox — unrelated to the change)🤖 Generated with Claude Code