[Bug]: codex adapter cannot launch Codex; bundle executable is named ChatGPT
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29.5k
- Forks
- 2.9k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 70
Description
### Description
`opencli codex ` cannot launch Codex. The launcher resolves the executable as `Codex.app/Contents/MacOS/`, and the `codex` entry in `src/electron-apps.ts` declares `processName: 'Codex'`. On current builds the only executable inside the bundle is named `ChatGPT`, so the path does not exist and every `codex` command fails before connecting.
```
$ ls /Applications/Codex.app/Contents/MacOS/
ChatGPT
```
The bundle identifier is still `com.openai.codex` and the app is still Codex; only the executable name differs.
`src/electron-apps.ts` already supports several candidate names through the optional `executableNames` field, used by the `antigravity` and `qoder` entries. The `codex` entry does not set it.
A second observation, recorded separately below, is that the process launched by `launchDetachedApp` does not retain `--remote-debugging-port`.
### Steps to Reproduce
1. Install Codex 26.727.51351 (bundle identifier `com.openai.codex`).
2. Quit Codex so no instance is running.
3. Run `opencli codex status`.
### Expected Behavior
`opencli codex status` starts Codex and reports the connection state, as it does for the other Electron app adapters.
### OpenCLI Version
1.8.6
### Node.js Version
Other
### Operating System
macOS
### Logs / Screenshots
```shell
$ opencli codex status
ok: false
error:
code: COMMAND_EXEC
message: 'Could not launch Codex: executable not found at /Applications/Codex.app/Contents/MacOS/Codex'
help: Install Codex, reinstall it, or register a custom app path in ~/.opencli/apps.yaml
exitCode: 1
$ /usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" /Applications/Codex.app/Contents/Info.plist
ChatGPT
$ /usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" /Applications/Codex.app/Contents/Info.plist
com.openai.codex
$ /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" /Applications/Codex.app/Contents/Info.plist
26.727.51351
# Second observation: the argument is passed but the running process does not carry it.
# Recorded here because it is a separate condition from the executable name.
$ OPENCLI_VERBOSE=1 opencli codex status
[verbose] [launcher] Probing CDP on port 9238...
[verbose] [launcher] Launching: /Applications/Codex.app/Contents/MacOS/ChatGPT --remote-debugging-port=9238 --remote-allow-origins=*
error:
code: COMMAND_EXEC
message: App launched but CDP not available on port 9238 after 15s
$ ps -eo args | grep MacOS/ChatGPT
/Applications/Codex.app/Contents/MacOS/ChatGPT
$ lsof -nP -iTCP:9238 -sTCP:LISTEN
(no listener)
# The same executable and arguments started from a shell do retain the argument
# and the CDP endpoint becomes available. Cause not determined.
$ /Applications/Codex.app/Contents/MacOS/ChatGPT --remote-debugging-port=9238 --remote-allow-origins='*' &
$ ps -eo args | grep MacOS/ChatGPT
/Applications/Codex.app/Contents/MacOS/ChatGPT --remote-debugging-port=9238 --remote-allow-origins=*
$ curl -s http://127.0.0.1:9238/json/version
{ "Browser": "Chrome/150.0.7871.182", "Protocol-Version": "1.3", ... }
$ opencli codex status
- Status: Connected
Url: app://-/index.html?initialRoute=%2Favatar-overlay
Title: Codex
# `open -b` also retains the argument.
$ open -b com.openai.codex --args --remote-debugging-port=9238 --remote-allow-origins='*'
$ ps -eo args | grep MacOS/ChatGPT
/Applications/Codex.app/Contents/MacOS/ChatGPT --remote-debugging-port=9238 --remote-allow-origins=*
```
Contributor guide
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.
Research direction
Start in src/electron-apps.ts and compare the codex entry with the existing executableNames usage in antigravity and qoder. Run opencli codex status against a Codex bundle whose executable is ChatGPT, then verify that the launcher finds the executable and reports connection status; the separate remote-debugging argument observation remains unresolved in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100