feat(#2300): recv reports remaining inbox depth so agents know how many messages are left

This commit is contained in:
damocles 2026-07-10 01:34:22 +02:00 committed by mara
commit 493face93c
6 changed files with 153 additions and 52 deletions

View file

@ -861,7 +861,15 @@ pub enum Response {
/// for `AckTurn`, and surfaced to claude as a `[msg #<id>]` marker
/// so `AckUntil` has something to reference) and the "previously
/// popped, not acked" flag — see `DeliveredMessage` for details.
Messages { messages: Vec<DeliveredMessage> },
/// `remaining` is the inbox depth *after* this batch was popped —
/// how many still-pending messages the caller could drain next. The
/// harness surfaces it to claude ("N more pending") so an in-turn
/// `recv` learns whether the inbox is drained, mirroring the count
/// the wake prompt already carries.
Messages {
messages: Vec<DeliveredMessage>,
remaining: u64,
},
/// `Status` result: how many pending messages are in this agent's inbox.
Status { unread: u64 },
/// `AckUntil` result: how many rows were newly marked handled.