Skip to main content

Module event_forwarder

Module event_forwarder 

Source
Expand description

Event forwarding from MPSC to broadcast channels.

Creates an MPSC channel for agent loop events and spawns a background task that relays events to the session’s broadcast sender while tracking runner diagnostic state (budget events, tool execution, round progress).

Structs§

HistoryCommitAcknowledger
Forwarder-owned half of HistoryCommitBarrier.
HistoryCommitBarrier
Completion signal for the durable history barrier emitted at the end of a run. The runner must not become replaceable until the forwarder has actually published SessionHistoryCommitted; merely enqueueing the event leaves a race where a successor can retire this generation first.

Functions§

create_event_forwarder
Create an MPSC channel for agent events and spawn a forwarding task that relays events to the broadcast sender while tracking runner diagnostic fields for live visibility.
create_event_forwarder_with_history_commit_barrier
Create an event forwarder plus a producer-side durable-history barrier. Runtime paths that finalize and replace runner generations must use this variant so they can await actual barrier publication before finalization.
create_event_forwarder_with_root_actor
The Root adapter passes its immutable capability before any Started frame. Legacy Child/Supervisor/standalone callers keep the existing queue behavior.
history_commit_barrier
Create the acknowledgment pair shared by an event producer and forwarder.
interrupt_root_on_authority_loss
Close only the obsolete run’s live transport. This is not a runtime-state publication: it never enters the account journal, replay cache, or storage. The exact local runner guard keeps this fixed error ahead of any successor’s Started frame on the shared session channel. A successor already installed in the registry must not receive the obsolete run’s error or cancellation. Server adapters share this boundary with the generic engine forwarder.

Type Aliases§

AccountFeedInbox
Inbox to the account-wide change feed: (session_id, event) before the writer assigns a seq. Threaded as Option so engine-internal callers that have no feed (tests, standalone embeddings) can pass None. Defined here so the engine stays free of any bamboo-server dependency.