codex - 💡(How to fix) Fix Programmatic chat creation API for Codex Desktop: spawn a sidebar-visible chat with initial prompt from an external orchestrator

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

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:

  1. 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 through open with a callback URL, or by writing to a known file path).
  2. Extension to codex remote-control: a new-chat subcommand that takes --prompt @file and --title "..." and prints the new thread ID. The infrastructure for remote-control is already in place (v0.130+).
  3. 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).
  4. 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 + codex CLI: Spawning a Terminal.app window that runs codex "prompt" produces a codex-tui session (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 with originator: codex_exec / source: exec that the Codex Desktop sidebar does not index at all. We verified the -c originator="Codex Desktop" override is explicitly blocked for exec mode ("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-control issues 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Programmatic chat creation API for Codex Desktop: spawn a sidebar-visible chat with initial prompt from an external orchestrator