diff --git a/TODO.md b/TODO.md index 3933ba53..a2d7b025 100644 --- a/TODO.md +++ b/TODO.md @@ -3,6 +3,21 @@ Pick anything from here when relevant. Cross-cutting design notes live in [CLAUDE.md](CLAUDE.md); high-level project intro in [README.md](README.md). +## Turn loop + +- **`recv` with no `wait_seconds` should return immediately.** + Today omitting the argument falls through to the 30s + default long-poll (`RECV_LONG_POLL_DEFAULT` in + `hive-c0re/src/agent_server.rs`); a manager that wants a + cheap "anything in the inbox right now?" peek has to + explicitly pass `wait_seconds: 0`. Flip the semantics so + `None` = no sleep, returning `None` (or the empty inbox + shape) right away. The agent opts into the long-poll by + setting a positive value. Update both `AgentRequest::Recv` + and `ManagerRequest::Recv` handlers + the prompt language + in `prompts/{agent,manager}.md`. Tighten the cap (180s) + too — only meaningful when the agent is choosing to wait. + ## Permissions / policy - **Per-agent send allow-list.** Today any agent can `send` to any @@ -73,6 +88,19 @@ Pick anything from here when relevant. Cross-cutting design notes live in ## UI / UX +- **Approval history tab on P3NDING APPR0VALS.** Today the + section renders pending rows only; once approved / denied / + failed they drop off the dashboard. Sqlite still has every + row (approvals table never deletes), and the meta git log + + applied repo's annotated `denied/` / `failed/` tags + already carry the human-readable reasons. A second tab — + `pending | history` — that scrolls the last N resolved + approvals with their terminal status, `resolved_at` + timestamp, operator note (deny), build error (failed), and + a quick link/diff to the `proposal/` tag would close + the loop so the operator can see "what went out, what got + rejected, why" without ssh-ing to the host. + - **Web UI for config repos + meta deploy log.** Browse per-agent proposed / applied tags (`proposal/* / approved/* / building/* / deployed/* / diff --git a/docs/turn-loop.md b/docs/turn-loop.md index 83a1f1ee..6a6bab3f 100644 --- a/docs/turn-loop.md +++ b/docs/turn-loop.md @@ -102,43 +102,16 @@ it as a stdio child via `--mcp-config`. The hyperhive socket name is - `send(to, body)` — message a peer (logical agent name), another agent, or the operator (recipient `operator`, surfaces in the dashboard inbox). -- `recv(wait_seconds?)` — drain one inbox message. Without - `wait_seconds` (or with `0`) returns immediately, a cheap - "anything pending?" peek. Positive value parks the turn up - to that many seconds (cap 180) — incoming messages wake - instantly, otherwise returns empty at the timeout. +- `recv(wait_seconds?)` — drain one inbox message. Long-polls + server-side; `wait_seconds` is capped at 180 (default 30 when + omitted). Agents use a long wait to park their turn waiting for + work instead of busy-looping with short polls — they wake + instantly when a message arrives. - `ask_operator(question, options?, multi?, ttl_seconds?)` — surface a question on the dashboard. Same shape as the manager's; answer routes back to the asker's own inbox as `HelperEvent::OperatorAnswered` via `coord.notify_agent`. -### Waking the agent from inside the container - -External MCP servers (and any other in-container process) can -inject a wake-up event into the agent's inbox via the per-agent -socket at `/run/hive/mcp.sock`. Two equivalent paths: - -- **Shell out to `hive-ag3nt wake --from