Programmatic chat creation API for Codex Desktop: spawn a sidebar-visible chat with initial prompt from an external orchestrator
What variant of Codex are you using?
App
What feature would you like to see?
A way for an external tool to programmatically create a new chat in Codex Desktop's live "Chats" sidebar with a provided initial prompt, and receive back a chat/thread ID that the external tool can use for status checks and clean teardown.
The concrete shape is up to your team. Plausible options:
- URL scheme:
codex://new?prompt=<url-encoded-prompt>&title=<url-encoded-title>that activates Codex Desktop, creates the chat in the live sidebar, and returns the new thread ID (e.g., via stdout when invoked throughopenwith a callback URL, or by writing to a known file path). - Extension to
codex remote-control: anew-chatsubcommand that takes--prompt @fileand--title "..."and prints the new thread ID. The infrastructure for remote-control is already in place (v0.130+). - App-side MCP tool exposed by Codex Desktop that other agents can call (similar to how Codex.app already speaks to MCP servers in the other direction).
- App-server endpoint that an external process can POST to with the same payload.
Why I need this
I built a plugin (codex-fleet for Claude Code) that orchestrates parallel Codex chats: one operator command opens an orchestrator chat + N lane chats, each pre-loaded with its coordination prompt, so multiple Codex agents work in parallel on a shared cycle with a shared coord document. This is the workflow OpenAI's own multi-architect coordination docs describe (orchestrator + Lane A + Lane B), and it currently requires the operator to manually copy-paste each lane prompt into separate Codex Desktop windows.
I've tried two existing mechanisms and neither fully works:
- Terminal +
codexCLI: Spawning a Terminal.app window that runscodex "prompt"produces acodex-tuisession (source: cli) that does appear in Codex.app's Archived chats list — but only after the session ends and the app reloads its archive cache, and never in the live "Chats" sidebar. It also leaks Terminal windows that have to be cleaned up by AppleScript. codex exec "prompt": Produces sessions withoriginator: codex_exec/source: execthat the Codex Desktop sidebar does not index at all. We verified the-c originator="Codex Desktop"override is explicitly blocked forexecmode ("Failed to set codex exec originator override").
The result: there is no path today to land a chat in the live sidebar from an external orchestrator without driving Codex Desktop's UI with AppleScript keystrokes, which is brittle, requires Accessibility permission, can't capture the thread ID, and breaks if the operator is typing.
Additional information
Related issues I found that touch nearby territory but don't cover this:
- #24083 (sidebar metadata) — about display of existing chats, not creation
- #24060 (auto-updated chat titles) — title behavior of existing chats
- #21657 (custom interaction hooks for desktop pets) — closest in spirit; extends Codex Desktop with external hooks
- The various
remote-controlissues are mostly about mobile pairing and auth, not chat creation
If this lands, the codex-fleet plugin (and any similar orchestrator) becomes a one-command parallel-launch tool where each spawned Codex chat is operator-visible in the live sidebar with full session metadata, and cancel/cleanup is targeted by returned thread ID instead of relying on UI scripting.
Happy to provide the codex-fleet plugin source as a concrete consumer-side reference if useful.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗