symcc

Spike: can a symcc daemon beside Codex reach the lead and run workers? #

Task T-239. Hands-on checks on 2026-11-16 with Codex CLI 0.163.0 (/Users/georgekour/.npm-global/bin/codex; the codex on PATH is a cmux wrapper that adds --dangerously-bypass-hook-trust). Follows docs/research/codex-host.md (T-233), docs/research/host-independence.md (T-234) and docs/research/standalone-cli.md (T-235).

Short answer #

Go. A symcc daemon beside Codex can do all four things it needs:

Blockers and rough edges (none of them stop the plan):

  1. Hooks only run after they are trusted: a hash is stored in config.toml under hooks.state."<key>".trusted_hash, normally set by the owner with /hooks. symcc's install step would have to ask the owner to trust its hooks once.
  2. Workers start slowly: about 10 to 20 s before the first model call.
  3. A worker stopped early prints no turn.failed event. The daemon has to judge "stopped" from the exit code and the missing turn.completed.
  4. MCP tools need default_tools_approval_mode = "approve", or calls fail when approvals are off.
  5. Not confirmed: turn/steer (adding to a turn while it runs) through the app-server socket. My client hung during the handshake (see below). codex queue covers the main need anyway.
  6. Every check below used a fake model (see next section). How a real model reacts to these messages was not tested.

How the experiments were run (no tokens) #

Experiment 1: telling the running lead something (codex queue) - worked #

Setup: the TUI ran in a private tmux server:

tmux -L cxs new-session -d -s lead -x 160 -y 45 \
  "CODEX_HOME=/tmp/cxs/home /Users/georgekour/.npm-global/bin/codex -C /tmp/cxs/work"

The TUI starts its own app-server daemon (<CODEX_HOME>/packages/app-server-daemon/releases/0.163.0-aarch64-apple-darwin/bin/codex app-server --listen unix:// --managed-daemon, plus app-server daemon pid-update-loop). Its socket is <CODEX_HOME>/app-server-control/app-server-control.sock, a link to /private/tmp/codex-daemon-501/<hash>.

Why try 1 got stuck: tmux send-keys "text" Enter in one call leaves the text in the input box (the Enter seems to be read as part of a paste; a guess). Sending Enter as a second, separate send-keys call submits it. The owner's first prompt also makes Codex send one extra small model request to name the session ("Capitalize only the first word ... User prompt: ...").

The session id comes from the hook input (session_id) or from the MCP _meta (exp 2). Then:

a) Lead idle:

$ CODEX_HOME=/tmp/cxs/home codex queue --thread 01a1e349-28ef-7631-9e15-e16b990a1903 \
    --message "queued from daemon while idle"
Queued message 01a1e34a-aeee-7452-87a6-acda13101dba for thread 01a1e349-...
(0.17 s total)

The TUI showed › queued from daemon while idle / • ACK: queued from daemon while idle, with no typing. Queued at 1794814684.75 (epoch seconds), and the model request reached the fake server at 1794814685.19, so about 0.45 s.

b) Lead busy: I queued "please run slow work" (the fake server waits 15 s on it), then 3 s later queued "second queued while busy". The second message was not mixed into the running turn. It ran as its own turn right after the first turn (and its Stop-hook continuation, see exp 4) ended: the requests reached the server at 771.2 (slow), 772.6 (Stop hook text) and 773.1 (second message). So the queue is first in, first out, one turn per message.

Limits seen: the message shows up as if the user had typed it (a › line), so the lead can't tell it came from the daemon unless the text says so. codex queue needs the session to be loaded by the app-server daemon. I only tested with the TUI running; queueing for a closed session was not tested.

c) turn/steer / turn/start over the socket: not confirmed. The app-server schema (codex app-server generate-json-schema) lists thread/start, thread/resume, thread/read, thread/list, turn/start, turn/steer (needs threadId, expectedTurnId, input), turn/interrupt, hooks/list, and a thread/queue/changed notification. thread/queue/add (used by codex queue) is not in the normal schema, so it is probably experimental (a guess). A JSON-RPC client over plain codex app-server (stdio) worked (hooks/list, below). The same client through codex app-server proxy (stdio to the daemon socket) hung after initialize, and I stopped it. I did not find out why. The time ran out before I could try further.

Experiment 2: a tiny MCP server (worked under codex exec, try 1) #

Experiment 3: workers with codex exec --json (worked, try 1 and again here) #

Experiment 4: hooks - worked, and the Stop hook is a second way in #

Events, from https://learn.chatgpt.com/docs/hooks: SessionStart, SessionEnd, SubagentStart, SubagentStop, PreToolUse, PermissionRequest, PostToolUse, PreModelRequest, PostModelRequest, PreCompact, PostCompact, UserPromptSubmit, Stop, Interrupt. Hook types are command and mcp_tool. Async hooks deliver their output "at the next safe point". From the same page: hooks go in hooks.json or [hooks] in config.toml. A hook gets one JSON object on stdin (session_id, transcript_path, cwd, hook_event_name, model, turn_id, permission_mode, plus prompt for UserPromptSubmit and stop_hook_active / last_assistant_message for Stop). Text a UserPromptSubmit hook prints to stdout is added as developer context. For Stop, decision: "block" "tells Codex to continue", using reason as the new prompt.

What I ran: <CODEX_HOME>/hooks.json:

{"hooks":{"UserPromptSubmit":[{"hooks":[{"type":"command","command":"/tmp/cxs/hook.sh"}]}],
          "Stop":[{"hooks":[{"type":"command","command":"/tmp/cxs/stop.sh"}]}]}}

hook.sh appends its stdin to a log (standing in for "call the daemon"). stop.sh does the same, and if /tmp/cxs/inbox has text, it prints {"decision":"block","reason":"<text>"} and deletes the inbox.

What I couldn't run #

Build a small Codex daemon prototype on these pieces:

Before building, repeat exp 1 once with a real model when the limit resets (2026-11-18). This checks that the lead acts sensibly on queued and Stop-hook messages.