recv mcp tool: default max to a small batch of 5 (wire default stays 1)

This commit is contained in:
damocles 2026-07-02 21:41:53 +02:00 committed by mara
commit d46d3c261b
3 changed files with 31 additions and 23 deletions

View file

@ -119,9 +119,13 @@ in `hive-c0re::dashboard_events::DashboardEvent`.
`AgentRequest::Recv` is the only path that delivers messages to an
agent. Always returns a list (`Messages { messages }`) — empty when
nothing's pending, single-pop when `max = None` (default 1, the
single-message behaviour), batched up to `max` when caller asks for
more (server-side cap is 32; values above clamp silently).
nothing's pending, single-pop when `max = None` (wire default 1),
batched up to `max` when the caller asks for more (server-side cap
is 32; values above clamp silently). The wire default MUST stay 1:
the harness turn loop sends `max: None` and consumes only the first
message, so a bigger server-side default would silently drop the
rest of a popped batch. The agent-facing `recv` MCP tool defaults to
`max = 5` at the tool layer instead (a small batch per call).
`wait_seconds` long-polls for the first message; once one arrives —
or one is already pending — the call drains up to `max` in total
before returning, so a single `Recv` call coalesces a burst.