Skip to main content

Module event

Module event 

Source
Expand description

The event stream published by the agent main loop to external consumers.

§Decoupling-by-shape

The main loop emits only AgentEvent — an internal enum — and three independent consumers each take what they need:

               ┌──► defect-acp     (translated into SessionUpdate / PromptResponse)
AgentEvent ────┼──► defect-storage (jsonl persistence)
               └──► tracing        (structured logging, observability)

We define the enum variants ourselves (decoupling the persistence format from the wire, and expressing semantics absent from the wire such as turn boundaries and LLM calls), but we reuse ACP’s passive data structures (ToolCallUpdateFields, ContentBlock, StopReason, etc.) as field types wherever possible, to avoid reinventing fields.

Structs§

LlmRequestSnapshot
A snapshot of an LLM call request, containing only the fields needed for observability to reconstruct the generation input (system prompt + full message history). Does not include tools, sampling parameters, etc.

Enums§

AgentEvent
Events published by the agent main loop.
PermissionResolution
The user’s response to an Ask.