CLI Internals
CLI Lifecycle
Follow a thread from session registration to streamed completion or failure.
Session Lifecycle
- CLI resolves profile config.
- CLI registers a session with the backend.
- CLI sends periodic heartbeats.
- CLI listens for pending thread work.
Thread Lifecycle
- pending thread discovered
- thread claimed with a lease
- unprocessed user messages batched
- assistant envelope created
- runtime executed
- chunks appended during streaming
- assistant finalized as completed or failed
Important Property
A single thread is processed sequentially under its claim, even when the CLI handles multiple threads concurrently overall.