Expand description
A poll-only observer of a Codex app-server’s thread status.
The source of exact state for Codex sessions omni-dev codex-wrap launches
(#1910, ADR-0088), the Codex analogue of the claude-wrap stream tracker.
Codex’s app-server speaks JSON-RPC over a WebSocket; with
--listen unix://PATH the WebSocket rides a Unix socket. Its
thread/loaded/list names the threads in memory and thread/read gives
each one’s status: idle, systemError, notLoaded, or active with
activeFlags waitingOnApproval / waitingOnUserInput. That is the state
the Codex hooks can only infer.
Two rules keep an observer from ever acting on a session:
- Poll, never subscribe. The observer calls only
initialize,thread/loaded/listandthread/read. It never starts, resumes or subscribes to a thread, so the server never routes a thread’s approval requests to it (verified on 0.155.1: an observer connection received no server request while the TUI on the same server sat on an approval). - Never answer. If a server request does arrive, it is dropped unanswered, so an observer cannot approve, deny or duplicate one.
This module holds the client and the pure mapping; the process wiring lives
in crate::cli::codex_wrap.
Structs§
- AppServer
Client - A connected, initialized app-server client.
- Snapshot
- One poll’s result; see
AppServerClient::snapshot. - Status
Tracker - Turns successive
snapshots into reports. - Thread
View - The fields of a
Threadthe observer reads.
Enums§
- Report
- One thing the tracker wants the daemon to hear.
Functions§
- state_
for_ status - Maps a
ThreadStatusonto aSessionState.NonefornotLoadedand any status this build does not know.systemErrorreads as idle: the turn is over and the session waits for the user.