Skip to main content

Module codex_app_server

Module codex_app_server 

Source
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/list and thread/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§

AppServerClient
A connected, initialized app-server client.
Snapshot
One poll’s result; see AppServerClient::snapshot.
StatusTracker
Turns successive snapshots into reports.
ThreadView
The fields of a Thread the observer reads.

Enums§

Report
One thing the tracker wants the daemon to hear.

Functions§

state_for_status
Maps a ThreadStatus onto a SessionState. None for notLoaded and any status this build does not know. systemError reads as idle: the turn is over and the session waits for the user.