pub struct SessionToolEventSink { /* private fields */ }Expand description
Forwards AgentLoop tool-dispatch hooks to a specific session’s
SessionRegistry::record_tool_* calls (#2056).
Why: the seam that makes a daemon-driven run’s tool activity observable
to a session.attached client, over both the PM’s own loop and any
delegated sub-agent loop that shares this same Arc.
What: See module docs.
Test: task::sink::tests::forwards_started_finished_and_error.
Implementations§
Trait Implementations§
Source§impl ToolEventSink for SessionToolEventSink
impl ToolEventSink for SessionToolEventSink
Source§fn tool_telemetry<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
telemetry: &'life5 ToolTelemetry,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn tool_telemetry<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
telemetry: &'life5 ToolTelemetry,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Fan a tool’s structured telemetry out to the matching #UI-Phase-1
record_* call.
Why: the variant-to-record mapping belongs here, in the daemon-glue
layer, rather than in agent_loop (which must not know about
SessionRegistry) or in the tools (which must not know about
sessions at all).
What: same log-and-swallow contract as the hooks above — a vanished
session must never derail a run.
Test: tests::forwards_search_and_recall_telemetry.
Source§fn context_budget<'life0, 'life1, 'async_trait>(
&'life0 self,
snapshot: &'life1 ContextBudgetSnapshot,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn context_budget<'life0, 'life1, 'async_trait>(
&'life0 self,
snapshot: &'life1 ContextBudgetSnapshot,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Forward the per-turn working-context measurement to this session’s event stream (epic #2343). Same log-and-swallow contract as the tool hooks above: a vanished session must never fault the PM’s turn boundary — telemetry is not worth failing the work it observes.
Source§fn agent_message<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
turn_id: &'life3 str,
delta: &'life4 str,
done: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn agent_message<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
turn_id: &'life3 str,
delta: &'life4 str,
done: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Forward one assistant turn’s text to this session’s event stream
(tcode streaming epic #3696, Gap A, Slice 1). Same log-and-swallow
contract as the hooks above: a vanished session must never fault the
loop that observed the turn.
Test: tests::agent_message_reaches_stream_as_delta.
Source§fn tool_started<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
args_preview: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn tool_started<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
args_preview: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Source§fn tool_finished<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
success: bool,
result_preview: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn tool_finished<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
success: bool,
result_preview: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
success distinguishes the two). Use Self::tool_error instead for an
exceptional (non-recoverable) failure.Source§fn tool_error<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
error: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn tool_error<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
agent: &'life1 str,
agent_id: &'life2 str,
call_id: &'life3 str,
tool: &'life4 str,
error: &'life5 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Auto Trait Implementations§
impl Freeze for SessionToolEventSink
impl RefUnwindSafe for SessionToolEventSink
impl Send for SessionToolEventSink
impl Sync for SessionToolEventSink
impl Unpin for SessionToolEventSink
impl UnsafeUnpin for SessionToolEventSink
impl UnwindSafe for SessionToolEventSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more