Watch
0
0
Fork
You've already forked hyperhive
0

remove the hive dashboard's stats page and the price table behind it

The ST4TS page (/stats.html), GET /api/stats-hive, hive-c0re's hive_stats
rollup and the modelPrices option that only fed its cost estimate are
gone. Each agent's own /stats page and the turn-stats database it reads
are unchanged. Setting modelPrices now fails evaluation with a message
saying so.
This commit is contained in:
iris 2026-11-02 23:15:51 +01:00 • committed by mara
commit 5e9a22cb38

View file

@ -45,7 +45,7 @@ mod test_env;
mod workers;
pub(crate) use agent_config::{archetypes, limits, permissions, resource_limits, topology};
pub(crate) use stats::{container_stats, hive_stats, host_stats, otel_metrics, warnings};
pub(crate) use stats::{container_stats, host_stats, otel_metrics, warnings};
pub(crate) use stores::{broker, build_logs, db, power};
pub(crate) use workers::{agent_sockets, auto_update, crash_watch, knowledge, mcp_sockets};
@ -69,7 +69,7 @@ enum Cmd {
/// Path to a JSON config file holding the host-level daemon config
/// (the [`ServeConfig`] shape:
/// the container-injected `HiveEnv` fields + the hive-c0re-local
/// `model_prices` table). Used as the base; any per-flag override
/// `build_slots`). Used as the base; any per-flag override
/// below wins over the file. Absent → start from the built-in
/// defaults. The NixOS module passes a generated config here so the
/// `ExecStart` stays short instead of carrying every setting — and
@ -106,14 +106,6 @@ enum Cmd {
/// `services.hyperhive.agentIoWeight`.
#[arg(long)]
agent_io_weight: Option<u32>,
/// Override: per-model USD prices (per million tokens) for the
/// hive-wide ST4TS cost estimate, as a JSON object mapping a
/// model-family short name to `{input, output, cache_read,
/// cache_write}`. Models not covered fall back to the built-in
/// estimate. Set via the `services.hyperhive.modelPrices` NixOS
/// option.
#[arg(long)]
model_prices: Option<String>,
/// Override: number of concurrent closure-fetching job-queue nodes
/// (prebuild / profile-swap / create / meta lock). Set via the
/// `services.hyperhive.deploy.hive-controller.buildSlots` NixOS option.
@ -138,7 +130,6 @@ async fn main() -> Result<()> {
agent_memory_max,
agent_cpu_weight,
agent_io_weight,
model_prices,
build_slots,
} => {
// Base config from the --config file (or the built-in
@ -175,10 +166,6 @@ async fn main() -> Result<()> {
if let Some(v) = agent_io_weight {
sc.env.agent_io_weight = Some(v);
}
if let Some(v) = model_prices {
sc.model_prices =
serde_json::from_str(&v).context("--model-prices: invalid JSON")?;
}
if let Some(v) = build_slots {
sc.build_slots = v;
}
@ -194,7 +181,7 @@ async fn main() -> Result<()> {
// The forge integration is mandatory (the NixOS module sets both
// vars unconditionally), so check them before any worker starts.
forge::validate_env()?;
cmd_serve(sc.env, sc.model_prices, sc.build_slots, db, &cli.socket).await
cmd_serve(sc.env, sc.build_slots, db, &cli.socket).await
}
}
}
@ -225,7 +212,6 @@ fn submit_periodic_sweep(
)]
async fn cmd_serve(
env: HiveEnv,
model_prices: crate::hive_stats::PriceTable,
build_slots: usize,
db: std::path::PathBuf,
socket: &std::path::Path,
@ -238,7 +224,7 @@ async fn cmd_serve(
// `dashboard_port` is consumed into the Coordinator below; capture the
// Copy value first for the dashboard + knowledge-webhook tasks.
let dashboard_port = env.dashboard_port;
let coord = Arc::new(Coordinator::open(&db, env, model_prices, build_slots)?);
let coord = Arc::new(Coordinator::open(&db, env, build_slots)?);
// Idempotent pre-flight: rewrite pre-meta-layout applied
// repos, refresh the files that follow the agent set.
// Runs before the boot reconcile.
@ -340,7 +326,7 @@ async fn cmd_serve(
// agent-owned, so host-side deletes hit PermissionDenied / readonly-db
// under privsep. See issue tracker "perms borked".
// (turn-stats.sqlite has no vacuum — it's one tiny row per turn,
// ~hundreds of KB, and the /stats + hive-stats views read it
// ~hundreds of KB, and the agent's own /stats page reads it
// directly; pruning it would just lose trend history for no gain.)
// Slow per-container disk sampler: hive-priv measures each agent's state/
// + work/ + writable rootfs every 30 min, cached so a sample only reads