Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const AGENT_PROVIDERS: AgentProviderDefinition[] = [
description:
'CLI that connects to OpenAI models for project-aware code assistance and terminal workflows.',
docUrl: 'https://github.com/openai/codex',
installCommand: 'npm install -g @openai/codex',
installCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh',
commands: ['codex'],
versionArgs: ['--version'],
cli: 'codex',
Expand Down
61 changes: 54 additions & 7 deletions packages/plugins/src/agents/impl/codex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
buildStandardCommand,
codexMcpAdapter,
homebrewOption,
npmDependency,
} from '@emdash/core/agents/plugins/helpers';
import { buildCodexHookConfig } from './hooks';
import { icon } from './icon';
Expand Down Expand Up @@ -54,23 +53,71 @@ export const plugin = definePlugin(
scope: 'global',
supportedEvents: ['notification', 'stop', 'session'],
},
hostDependency: npmDependency({
hostDependency: {
id: 'codex',
package: '@openai/codex',
extraOptions: {
macos: [homebrewOption({ formula: 'codex', cask: true })],
linux: [homebrewOption({ formula: 'codex', cask: true })],
binaryNames: ['codex'],
installCommands: {
macos: [
{
method: 'curl',
command: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh',
updateCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh',
recommended: true,
},
{
method: 'npm',
command: 'npm install -g @openai/codex',
updateCommand: 'npm install -g @openai/codex',
uninstallCommand: 'npm uninstall -g @openai/codex',
},
homebrewOption({ formula: 'codex', cask: true }),
],
linux: [
{
method: 'curl',
command: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh',
updateCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh',
recommended: true,
},
{
method: 'npm',
command: 'npm install -g @openai/codex',
updateCommand: 'npm install -g @openai/codex',
uninstallCommand: 'npm uninstall -g @openai/codex',
},
homebrewOption({ formula: 'codex', cask: true }),
],
windows: [
{
method: 'powershell',
command:
'powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"',
updateCommand:
'powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"',
recommended: true,
},
{
method: 'npm',
command: 'npm install -g @openai/codex',
updateCommand: 'npm install -g @openai/codex',
uninstallCommand: 'npm uninstall -g @openai/codex',
},
],
},
}),
updates: {
kind: 'supported',
releaseSource: {
kind: 'npm',
package: '@openai/codex',
},
update: {
kind: 'package-manager',
},
},
uninstall: {
kind: 'package-manager',
},
Comment on lines +117 to +119

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

},
mcp: {
kind: 'supported',
scope: 'global',
Expand Down
Loading