Expand description
Codex CLI: start a turn in a running thread through codex app-server.
The operator runs one app-server (codex app-server --listen unix:// or
--listen ws://127.0.0.1:PORT) and attaches the interactive TUI to it
with codex --remote <same endpoint>. This adapter is a second client on
that server. Wire (verified against codex-cli 0.160.1 on the box):
one JSON-RPC message per WebSocket text frame, no "jsonrpc" member;
initialize → initialized → turn/start {threadId, input}. A thread
the server has not loaded answers thread not found; the adapter then
sends thread/resume {threadId} and retries turn/start once.
turn/start on a thread with an active turn is accepted by the server.
The other client (the TUI) sees turn/started and the user item.
unix:// uses a Unix domain socket and is unix-only here; Windows uses
ws://127.0.0.1:PORT. Non-loopback ws:// is refused.
Modules§
- desktop
- Desktop follower IPC (inspected on Desktop 26.1007.2314.0). Routes to the existing thread owner. No provider spawn, auth access, thread creation or UI input. Internal protocol: fail closed on drift.
Structs§
- Codex
AppServer Adapter - Second client on the operator’s Codex app-server.
Enums§
- Codex
Endpoint - Where the shared app-server listens.
Constants§
- CODEX_
APP_ SERVER_ ENV - Env var naming the app-server endpoint (
unix:///pathorws://127.0.0.1:PORT).
Functions§
- initialize_
request initializerequest (exact shape verified on 0.160.1).- start_
turn - Runs the handshake and one
turn/start(with one resume retry) on an open WebSocket. Generic over the stream so tests use a fake server. - thread_
resume_ request thread/resumerequest.- turn_
start_ request turn/startrequest with one text input.