pub fn spawn_ui_forwarder(
receiver: DeltaReceiver,
ui_budget_bytes: usize,
cancel: CancellationToken,
emit: impl Fn(String) + Send + 'static,
) -> JoinHandle<()>Expand description
Spawn the forwarding task for one tool call: drains the bounded channel,
enforces the UI-preview byte budget at production time (UTF-8-safe via
BoundedText), and terminates on cancellation or channel close. On
termination the receiver drops, closing the channel and RELEASING every
producer (their sends become counted drops).