Mutable state accumulated while iterating over the agent stream.
StreamState(
self,
quiet: bool = False,
stream: bool = True,
full_response: list[str] = list(),
tool_call_buffers: dict[int | str, dict[str, str | None]] = dict(),
pending_interrupts: dict[str, HITLRequest] = dict(),
hitl_response: dict[str, dict[str, list[dict[str, str]]]] = dict(),
interrupt_occurred: bool = False,
stats: SessionStats = SessionStats(),
spinner: _ConsoleSpinner | None = None
)When True, diagnostic formatting that would otherwise go to stdout
(e.g. separator newlines before tool notifications) is suppressed so that
stdout contains only agent response text.
When True (default), text chunks are written to stdout as they arrive.
When False, text is buffered in full_response and flushed after the
agent finishes.
Accumulated text fragments from the AI message stream.
Maps a tool-call index or ID to its name/ID metadata for in-progress tool calls.
Maps interrupt IDs to their validated HITL requests that are awaiting decisions.
Maps interrupt IDs to dicts containing a 'decisions' key with a list of
decision dicts (each having a 'type' key of 'approve' or 'reject').
Used to resume the agent after HITL processing.
Flag indicating whether any HITL interrupt was received during the current stream pass.
Accumulated model usage stats for this stream.
Optional animated spinner shown during agent work in verbose mode.