pub struct BufferingSink { /* private fields */ }Expand description
A sink that buffers a narrative trace of bg-agent activity.
#1022 B9: pre-fix, bg agents ran with NullSink so every
event inside them — tool calls, info lines, approval requests,
errors — was silently dropped. The user only saw two lines: the
spawn message and the completion message. The model only saw the
final output. What the bg agent actually did was opaque.
BufferingSink records short, human-readable lines for events
that matter for traceability:
ToolCallStart→" 🔧 ToolName"Info→ forwarded as-is (sub-agent emits info for things like nested spawn / cache hit)ApprovalRequest/AskUserRequest→ short auto-reject note (they auto-reject on closed channel — see B10)- Streaming text (
TextDelta/TextDone) is not recorded — the final output already crosses the result oneshot, so capturing text here would duplicate it.
Drained at result-injection time and emitted as a multi-line
Info event so the user sees ✅ bg agent X completed\n 🔧 Read\n 🔧 Bash\n … instead of just ✅ bg agent X completed.
Cap is intentionally generous (256 lines): a runaway bg agent
could otherwise grow this unboundedly. After the cap we record a
single … (trace truncated at N lines) marker and stop.
Implementations§
Source§impl BufferingSink
impl BufferingSink
Trait Implementations§
Source§impl Default for BufferingSink
impl Default for BufferingSink
Source§impl EngineSink for BufferingSink
impl EngineSink for BufferingSink
Source§fn emit(&self, event: EngineEvent)
fn emit(&self, event: EngineEvent)
Auto Trait Implementations§
impl !Freeze for BufferingSink
impl RefUnwindSafe for BufferingSink
impl Send for BufferingSink
impl Sync for BufferingSink
impl Unpin for BufferingSink
impl UnsafeUnpin for BufferingSink
impl UnwindSafe for BufferingSink
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