Context
agmsg's existing Codex monitor targets the Codex CLI: it intercepts the codex
command (shell function / opt-in PATH shim) and routes inbound messages as turns via
the bridge + app-server. We'd like the same delivery for Codex Desktop (the GUI
app): inject into the Desktop session when unread mail arrives. The CLI approach
(intercept the launch command) doesn't transfer directly — the Desktop app launches
itself, so there is no command to intercept.
Prior art — PoC in #260
#260 demonstrates a working delivery path (reported working on Windows): it owns a
codex app-server and drives it over WebSocket JSON-RPC — initialize, load a thread,
then start a turn with the message body as the prompt. So messages do reach a Codex
thread. It also adds a supervisor scaffold (project-scoped singleton, heartbeat
liveness, mailbox cursor, single-writer). The committed tests use a mock adapter, so the
in-repo evidence is feasibility-level; the live end-to-end is reported by the contributor.
What's open for a production path
- Stable/supported transport. The PoC drives
codex app-server --listen ws://....
Recent Codex (0.142+) reworked the app-server surface (managed daemon + control
socket in place of --listen ws://), so this route needs to move onto the current
supported control surface — the same migration the CLI monitor faces.
- Thread/target selection.
--thread loaded assumes a single thread; we need a
rule for choosing the right Desktop conversation when several exist.
- Cross-platform. The PoC has Windows-specific pieces (powershell, taskkill,
AppData paths) to generalize.
- Productionization. Promote the mock-adapter path to a verified live-Desktop
end-to-end; decide the collector's body-handling boundary (it currently reads the
body to build the turn).
Question
For anyone running Codex Desktop: what is the most robust way to drive/inject into a
running Desktop session on current Codex versions? Input very welcome.
Out of scope
The one-line codex-bridge.js Windows fix (prepend the bash binary when arming the
watch) is a CLI-monitor improvement, tracked separately.
Context
agmsg's existing Codex monitor targets the Codex CLI: it intercepts the
codexcommand (shell function / opt-in PATH shim) and routes inbound messages as turns via
the bridge + app-server. We'd like the same delivery for Codex Desktop (the GUI
app): inject into the Desktop session when unread mail arrives. The CLI approach
(intercept the launch command) doesn't transfer directly — the Desktop app launches
itself, so there is no command to intercept.
Prior art — PoC in #260
#260 demonstrates a working delivery path (reported working on Windows): it owns a
codex app-serverand drives it over WebSocket JSON-RPC —initialize, load a thread,then start a turn with the message body as the prompt. So messages do reach a Codex
thread. It also adds a supervisor scaffold (project-scoped singleton, heartbeat
liveness, mailbox cursor, single-writer). The committed tests use a mock adapter, so the
in-repo evidence is feasibility-level; the live end-to-end is reported by the contributor.
What's open for a production path
codex app-server --listen ws://....Recent Codex (0.142+) reworked the app-server surface (managed daemon + control
socket in place of
--listen ws://), so this route needs to move onto the currentsupported control surface — the same migration the CLI monitor faces.
--thread loadedassumes a single thread; we need arule for choosing the right Desktop conversation when several exist.
AppData paths) to generalize.
end-to-end; decide the collector's body-handling boundary (it currently reads the
body to build the turn).
Question
For anyone running Codex Desktop: what is the most robust way to drive/inject into a
running Desktop session on current Codex versions? Input very welcome.
Out of scope
The one-line
codex-bridge.jsWindows fix (prepend the bash binary when arming thewatch) is a CLI-monitor improvement, tracked separately.