refactor(hive-agent): split the forge notification poller into its own crate
The poller was a `tokio::spawn` inside the `hive-agent` serve loop. It never needed anything from that loop except a socket path, so being in-process bought nothing and cost two things: a harness restart took forge notifications down with it, and the whole forge/HTTP dependency tree was linked into the serve-loop binary. It is now `hive-forge-notify`, a per-agent daemon with its own systemd unit, a sibling of `hive-bash-daemon` and `hive-matrix-daemon`. Same contract as those two: it reaches the harness only by upserting todos on the in-agent socket, and nowhere else. The module moves verbatim (`notify.rs`) — the formatters, the activation gates, the dedupe map and all 33 tests are unchanged. Only the socket call sites are rewritten, onto a small local `todo_client` rather than the harness's. That mirrors what both sibling daemons already do, and the etiquette differs on purpose: the harness's client carries a 60s backoff schedule sized to ride out a hive-c0re restart, which its callers need because they have no retry of their own. This poller's two call sites both sit inside the 30s poll loop and both treat a failure as "leave the thread unread, try next tick", so the poll interval already is the retry; a second backoff would only stack sleeps and delay the rest of the batch. The unit is `Restart=on-failure`, not `always`. An agent with no forge account is a supported configuration and the poller reports it by logging why and exiting 0 — under `always` that clean exit would be a restart loop on every forge-less agent. `forgejo-api`, `url` and `time` drop out of `hive-agent`'s dependencies with the module. Also corrects docs that outlived the code they described: the persisted `forge_cursor` field is long gone (forge's own read-state is the durable record of what has been delivered), but `docs/persistence.md` and the `harness_state` module docs still documented it as live.
This commit is contained in:
parent
d153d1d35f
commit
246c9471b1
18 changed files with 301 additions and 48 deletions
|
|
@ -45,7 +45,7 @@ hand-maintained per-file tree drifts out of sync with the code.
|
|||
- **`hive-agent/`** — the serve-loop binary: turn-loop *policy* layer
|
||||
(`turn.rs`) over the `hive-claude` driver, per-agent web UI (`web_ui/`
|
||||
module dir), event + turn-stats sqlite sinks, login flow, system-prompt
|
||||
renderer, forge-notify subscriber.
|
||||
renderer.
|
||||
- **`hive-agent-mcp/`** — the embedded MCP server (long-lived
|
||||
streamable-http listener, `hive-mcp-http` systemd unit) + its claude
|
||||
launch-config layer (tool-group/capability → `--allowedTools`,
|
||||
|
|
@ -62,6 +62,10 @@ hand-maintained per-file tree drifts out of sync with the code.
|
|||
`docs/boundary.md`.
|
||||
- **`hive-forge/`** — `hive-forge` Forgejo CLI wrapper; one module per
|
||||
verb under `src/verbs/`.
|
||||
- **`hive-forge-notify/`** — per-agent Forgejo notification poller daemon
|
||||
(`hive-forge-notify`); turns unread notification threads into todos on
|
||||
the harness's in-agent socket. Was a task inside the `hive-agent` serve
|
||||
loop; own process since it needs nothing else from the harness.
|
||||
- **`hive-matrix-mcp/`** — per-agent matrix-sdk daemon
|
||||
(`hive-matrix-daemon`); serves its MCP tools (`send_message`,
|
||||
`read_room`, …) directly over streamable-http (no stdio bridge),
|
||||
|
|
|
|||
Loading…
Reference in a new issue