From 40ec5ac9e06e5faa12e32ad46af14af86cec9d38 Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 12 Nov 2026 07:54:18 +0100 Subject: [PATCH] acp runtime: the queue cap's comment says it drops the newest item --- hive-runtime/src/acp/rpc.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hive-runtime/src/acp/rpc.rs b/hive-runtime/src/acp/rpc.rs index 46b47a062..ddb9ba347 100644 --- a/hive-runtime/src/acp/rpc.rs +++ b/hive-runtime/src/acp/rpc.rs @@ -207,9 +207,12 @@ impl Drop for Connection { } } -/// How many items wait for the harness before the oldest news is dropped. A -/// turn drains the queue as it goes, so only an agent that talks while no turn -/// runs gets near this; its items are thrown away at the next prompt anyway. +/// How many items wait for the harness before new ones are dropped. A turn +/// drains the queue as it goes, so only an agent that talks while no turn runs +/// gets near this; its items are thrown away at the next prompt anyway. Keeping +/// the oldest and dropping the newest means a sink that stalled mid-turn for +/// this many items would lose the latest output; that is the right side to +/// lose for the idle case this bounds. const INCOMING_CAP: usize = 4096; /// The sending half of the agent's output queue. A full queue drops the new @@ -230,7 +233,7 @@ impl Feed { if !self.full.swap(true, Ordering::Relaxed) { tracing::warn!( cap = INCOMING_CAP, - "ACP agent output is not being read; dropping what it sends until a turn drains it" + "ACP agent output is not being read; dropping what it sends once the queue is full (logged once per connection)" ); } true