In-flight conversation buffer keyed by session_id.
Holds turns until an explicit flush — session lifetime is owned by the
consumer; there is no idle-flush policy. On flush/1 (or shutdown via
flush_all/0 from terminate/2), the buffered turns are handed to the
configured flush_callback with retry: server-internal failures get the
configured backoff (default 1s/2s/4s); contract errors (4xx) and
upstream-LLM errors drop without retry.
See ex-capture-buffer in gralkor/TEST_TREES.md.
Summary
Functions
Append one turn (a list of Gralkor.Message) to the session's buffer.
Returns a specification to start this module under a supervisor.
Schedule a retry-backed flush of the session's turns. Returns :ok immediately.
Flush every buffered session and await each. Used at shutdown.
Return the buffered turns for session_id, or [] if none.
Functions
Append one turn (a list of Gralkor.Message) to the session's buffer.
agent_name is required and non-blank — it is bound on first append for
the session and any later append with a different agent_name (or
group_id) raises ArgumentError.
Returns a specification to start this module under a supervisor.
See Supervisor.
Schedule a retry-backed flush of the session's turns. Returns :ok immediately.
Flush every buffered session and await each. Used at shutdown.
Return the buffered turns for session_id, or [] if none.