Expand description
In-process app-server runtime host for local embedders.
This module runs the existing [MessageProcessor] and outbound routing logic
on Tokio tasks, but replaces socket/stdio transports with bounded in-memory
channels. The intent is to preserve app-server semantics while avoiding a
process boundary for CLI surfaces that run in the same process.
§Lifecycle
- Construct runtime state with
InProcessStartArgs. - Call
start, which performs theinitialize/initializedhandshake internally and returns a ready-to-useInProcessClientHandle. - Send requests via
InProcessClientHandle::request, notifications viaInProcessClientHandle::notify, and consume events viaInProcessClientHandle::next_event. - Terminate with
InProcessClientHandle::shutdown.
§Transport model
The runtime is transport-local but not protocol-free. Incoming requests are
typed ClientRequest values, yet responses still come back through the
same JSON-RPC result envelope that MessageProcessor uses for stdio and
websocket transports. This keeps in-process behavior aligned with
app-server rather than creating a second execution contract.
§Backpressure
Command submission uses try_send and can return WouldBlock, while event
fanout may drop notifications under saturation. Server requests are never
silently abandoned: if they cannot be queued they are failed back into
MessageProcessor with overload or internal errors so approval flows do
not hang indefinitely.
§Relationship to codex-app-server-client
This module provides the low-level runtime handle (InProcessClientHandle).
Higher-level callers (TUI, exec) should go through codex-app-server-client,
which wraps this module behind a worker task with async request/response
helpers, surface-specific startup policy, and bounded shutdown.
Structs§
- InProcess
Client Handle - Handle used by an in-process client to call app-server and consume events.
- InProcess
Client Sender - InProcess
Start Args - Input needed to start an in-process app-server runtime.
- LogDb
Layer
Enums§
- InProcess
Server Event - Event emitted from the app-server to the in-process client.
Constants§
- DEFAULT_
IN_ PROCESS_ CHANNEL_ CAPACITY - Default bounded channel capacity for in-process runtime queues.
Functions§
- start
- Starts an in-process app-server runtime and performs initialize handshake.
Type Aliases§
- State
DbHandle - Core-facing handle to the SQLite-backed state runtime.