Skip to main content
On main, not yet released — 0.32.1-SNAPSHOT, checked against agent-client main f89fc6b5. This tutorial uses the asynchronous lifecycle API built from main (at or after commit 4de205db). None of it is in 0.32.0. Snapshot content changes as main moves, so name the main commit you built against.
Resolve 0.32.1-SNAPSHOT from the Central snapshot repository, with snapshots enabled:
agent-client-claude supplies ClaudeClientProvider, the Claude Code lifecycle provider these examples run against. See Using development snapshots from main for pinning one build and reading its provenance.

Source on GitHub main

docs/examples/tutorials/ConversationInbox.java, compiled and run offline by the agent-client build
Bob and Doug work in one conversation. Their HTTP requests can arrive at any moment, including while the agent is still answering the other one. Agent Client runs one turn at a time per conversation and never queues a second prompt behind a running one. The application decides what waits and in what order. This tutorial’s inbox is application code, not a library API: a bounded first-in-first-out queue per conversation, with one worker that sends each input in arrival order.
Each input names its user, so the shared history records who asked what:
The worker takes the next input, runs it, and waits for the turn to terminate before taking another:
Three things to see:
  • An input that arrives mid-turn waits its turn. Doug’s request arrives while Bob’s turn runs. It is queued, and it is sent only after Bob’s turn has ended.
  • The queue advances on termination(), not on the result. Cancel Bob’s turn and its result is done at once (isDone() is true), but its process may still be stopping. A next input sent at that moment would be refused. termination() completes when the turn has really ended.
  • An overlapping submit is refused BUSY. Without the inbox, a second submit while a turn runs throws AgentOperationException with failure() BUSY, and nothing is sent. An endpoint that submits directly maps the refusal to an HTTP status:
The other refusals are CLEANUP_UNKNOWN, when a turn’s cleanup could not be confirmed and the conversation is quarantined, and CLOSED, when the conversation has ended. A full inbox answers FULL (HTTP 429), so a burst of inputs cannot grow the queue without bound. The full class is ConversationInbox.java. The build compiles this tutorial from docs/examples/tutorials and runs it against OfflineProvider, an offline stand-in that makes no model call (agent-client-tutorials, ConversationInboxTest). A live Claude Code run is not part of the build.