Context
Recent Codex CLIs (v0.149+; verified locally on 0.153.0-alpha.5) ship an experimental app-server daemon: codex app-server daemon start|stop|..., codex agents (browse agent sessions on the shared daemon), codex queue --thread <uuid> --message, WebSocket/unix-socket remote control with bearer auth, and protocol schema generators (codex app-server generate-json-schema).
However codex exec — what rein run uses for the Codex backend — is still a standalone foreground process:
So rein currently backgrounds codex exec itself and owns the log/status files (see the DEFAULT_CODEX_RUN_CMD comment in src/commands/exec.rs).
Proposal (experimental, opt-in)
Add a third Codex launch mode that talks JSON-RPC to the local app-server daemon instead of spawning codex exec:
- Ensure the daemon is up (
codex app-server daemon start, or connect to the control socket at $CODEX_HOME/app-server-control/app-server-control.sock).
- Create a thread with the task worktree as cwd, run a turn with the rein item/task prompt (
$REIN_PROMPT).
- Record the thread id in the task's
RunRecord (same shape as today — session, agent: "codex", item), stream turn events into <store>/runs/*.log so L / rein logs keep working, and reuse the existing post-run rein todo completeness check.
a (attach) keeps resuming by thread id; sessions launched this way should also show up in codex agents.
Config: rein.runAgent = codex-app-server (or a rein.codexDaemon = true toggle). Keep codex exec as the default.
Why not now
Trigger to pick this up
Context
Recent Codex CLIs (v0.149+; verified locally on 0.153.0-alpha.5) ship an experimental app-server daemon:
codex app-server daemon start|stop|...,codex agents(browse agent sessions on the shared daemon),codex queue --thread <uuid> --message, WebSocket/unix-socket remote control with bearer auth, and protocol schema generators (codex app-server generate-json-schema).However
codex exec— whatrein runuses for the Codex backend — is still a standalone foreground process:claude --bg-style "submit a background run to the daemon" CLI entry point,codex agentswon't list them),state_5.sqliteindex, not~/.codex/sessionsrollouts).So rein currently backgrounds
codex execitself and owns the log/status files (see theDEFAULT_CODEX_RUN_CMDcomment insrc/commands/exec.rs).Proposal (experimental, opt-in)
Add a third Codex launch mode that talks JSON-RPC to the local app-server daemon instead of spawning
codex exec:codex app-server daemon start, or connect to the control socket at$CODEX_HOME/app-server-control/app-server-control.sock).$REIN_PROMPT).RunRecord(same shape as today —session,agent: "codex",item), stream turn events into<store>/runs/*.logsoL/rein logskeep working, and reuse the existing post-runrein todocompleteness check.a(attach) keeps resuming by thread id; sessions launched this way should also show up incodex agents.Config:
rein.runAgent = codex-app-server(or arein.codexDaemon = truetoggle). Keepcodex execas the default.Why not now
[experimental]and churn between alphas; the daemon also requires the managed standalone Codex install (~/.codex/packages/standalone/current/codex).Trigger to pick this up
codex execgains a daemon/--remotesubmission path, or[experimental].