no nap tool — recv with long wait_seconds replaces it; max raised to 180s

recv-with-timeout is strictly better than a fixed sleep because it
wakes instantly on incoming messages. drop the half-written nap MCP
tool, raise the recv wait_seconds cap from 60s to 180s on both
agent and manager sockets.

prompts updated: agent.md + manager.md now spell out the pattern —
when there's nothing else useful to do, call recv with
wait_seconds=180 to park the turn; do NOT use Bash sleep for the
same purpose. todo drops the nap entry and the napping-state-badge
follow-up; both replaced by 'just use a long recv'.
This commit is contained in:
müde 2026-05-15 20:53:15 +02:00
parent f65ee88269
commit 7d93dd9db4
6 changed files with 16 additions and 21 deletions

View file

@ -166,7 +166,10 @@ impl AgentServer {
#[tool(
description = "Pop one message from this agent's inbox. Returns the sender and body, \
or an empty marker if nothing is waiting. Optional `wait_seconds` long-polls \
for that many seconds (capped at 60) before returning empty default 30."
for that many seconds (capped at 180) before returning empty default 30. \
Use a long wait_seconds (e.g. 120 or 180) when you have nothing else to do \
it parks the turn until either a message arrives or the timeout fires, which \
is strictly better than a fixed sleep because incoming work wakes you instantly."
)]
async fn recv(&self, Parameters(args): Parameters<RecvArgs>) -> String {
let log = format!("{args:?}");
@ -314,8 +317,10 @@ impl ManagerServer {
#[tool(
description = "Pop one message from the manager inbox. Returns sender + body, or \
empty. Optional `wait_seconds` long-polls (capped at 60, default 30) so the \
manager can sit on Recv when there's nothing to do without burning turns."
empty. Optional `wait_seconds` long-polls (capped at 180, default 30) so the \
manager can sit on Recv when there's nothing to do without burning turns \
prefer a long wait (120 or 180) over ending a turn early; you'll wake \
instantly when work arrives."
)]
async fn recv(&self, Parameters(args): Parameters<RecvArgs>) -> String {
let log = format!("{args:?}");