Skip to main content
OpenAI Codex integrates with EISPATCH through a UserPromptSubmit hook that blocks execution until you review and approve the prompt in the Local Composer. Because Codex does not expose a direct same-session dispatch API, approved prompts are delivered via clipboard fallback.

Verified version

EISPATCH v1.1.0 is verified with codex-cli 0.169.0.

Installation

Run the installer from the cloned repository:

What the installer writes

The installer modifies ~/.codex/ and adds the following:
  1. MCP server in ~/.codex/config.toml under mcp_servers.eispatch.
  2. UserPromptSubmit hook registered in the host.
  3. Skill installed to ~/.agents/skills/eispatch/.
Keep the cloned repository in place after installing. The installer references absolute paths inside it; moving the repo breaks the integration.

Hook flow

When you submit a prompt, the hook reads JSON from stdin containing at least prompt, session_id, and cwd. On trigger it follows this flow:
1

Intercept

The hook matches the trigger prefix and identifies that EISPATCH should handle the prompt.
2

Launch Local Composer

A detached process spawns core/launch-local-composer.mjs with --host codex, the prompt, workspace path, and a temporary ready-file path.
3

Wait for ready signal

The hook waits up to 2.5 seconds for the ready file to contain a JSON object with url, port, and pid.
4

Block and respond

The hook outputs a block JSON containing composerUrl so Codex can present the launcher URL.

Block JSON example

If the Local Composer fails to launch, the hook outputs instructions to start it manually via the MCP tool dispatch_compose or by running npm run preview.

Clipboard fallback flow

1

Launch

Open the Local Composer URL from the block message or start it with npm run preview.
2

Review

Review discovered capabilities, edit the final prompt, and click Approve.
3

Dispatch

Click Dispatch to copy the approved prompt to your clipboard.
4

Paste and submit

Paste the prompt into Codex and submit it. Prompts containing the compiled marker (<!-- DISPATCH_COMPILED_PROMPT) pass through the hook automatically.

Local Composer server

The Codex adapter uses the shared hardened Local Composer server (core/local-composer.mjs). It binds to 127.0.0.1 on an ephemeral port, requires a per-session token (401 if missing or wrong), and rejects requests whose Host, Origin, or Referer does not match the loopback address (403). Dispatch requires a one-time approval token bound to the SHA-256 hash of the approved prompt; missing or invalid approvals return 403, and replay or tampering returns 409. The hook’s launcher closes the server after 30 minutes without requests. Codex has no session injection API in EISPATCH, so dispatch always uses clipboard fallback. Native same-session dispatch is available only in Antigravity.

Environment variables

Check and uninstall

Verify the installation:
Remove EISPATCH entries:
Uninstall removes only EISPATCH-owned entries.