Watch
0
0
Fork
You've already forked hyperhive
0

remove hive and agent apis nothing calls: build-log routes, /api/compact, host.sock list, mcp.sock wake

This commit is contained in:
atlas 2026-11-13 02:48:37 +01:00
commit 36c7781245

View file

@ -11,9 +11,8 @@
//! reminder op then returns `Response::Err`); a reminder *firing* is a
//! separate path (`reminder_timer`), not driven through this socket.
//! `Request::Compact` is the odd one out — it doesn't touch any store, just
//! the harness's [`Bus`] (gate-checked context usage, then the same
//! deferred `compact_pending` flag the operator dashboard's `/compact`
//! button sets). No hive-c0re round-trip, no broker long-poll, no marker
//! the harness's [`Bus`] (gate-checked context usage, then the deferred
//! `compact_pending` flag). No hive-c0re round-trip, no broker long-poll, no marker
//! files.
//!
//! One request/response line per connection, matching the producers'
@ -39,8 +38,7 @@ use crate::todos::{Todo, Todos};
/// Context-usage floor for `Request::Compact`: below this fraction of the
/// effective context window, an agent-initiated compact is refused (nothing
/// meaningful to reclaim yet, and it'd just burn a compaction pass on a
/// near-empty session). Same number a human operator would eyeball off the
/// dashboard's `ctx·Nk` badge before hitting the `/compact` button.
/// near-empty session).
const COMPACT_MIN_USAGE_FRACTION: f64 = 0.66;
/// Pause after a failed `accept`, so a failure that persists (fd exhaustion)
@ -434,13 +432,10 @@ fn mark_todos_done(store: &Todos, ids: &[i64]) -> Response {
}
}
/// `Request::Compact` handler: gate on context usage, then queue the same
/// deferred `compact_pending` flag the operator's `/compact` button sets.
/// Mirrors `hive-agent::web_ui::actions::post_compact` but reachable from
/// the agent's own MCP tool instead of the dashboard, and refuses below
/// [`COMPACT_MIN_USAGE_FRACTION`] instead of always honouring the request —
/// an agent can call this speculatively, a human clicking the dashboard
/// button already made the judgment call. `wake_prompt`, when set, is
/// `Request::Compact` handler: gate on context usage, then queue the
/// deferred `compact_pending` flag. Refuses below
/// [`COMPACT_MIN_USAGE_FRACTION`] because an agent can call this
/// speculatively. `wake_prompt`, when set, is
/// forwarded to `Bus::request_compact` so the turn loop drives a synthetic
/// follow-up turn once the compaction actually finishes.
fn compact(bus: &Bus, wake_prompt: Option<String>) -> Response {