From dc11b0c414eea6a5e3d9993e53a29f0f46f7fc02 Mon Sep 17 00:00:00 2001 From: iris Date: Tue, 10 Nov 2026 19:40:07 +0100 Subject: [PATCH] hive ui: the container rows no longer show the active model or the context size Removes the model pill and the ctx chip from the hive dashboard's container rows, with their styles and the page's fingerprint field. The agent's own status already carries context and cost in the swarm UI. --- docs/2-handbook/hives/dashboard.md | 26 ++-------- frontend/packages/dashboard/src/agents.js | 59 ++-------------------- frontend/packages/dashboard/src/common.css | 22 -------- 3 files changed, 7 insertions(+), 100 deletions(-) diff --git a/docs/2-handbook/hives/dashboard.md b/docs/2-handbook/hives/dashboard.md index 8a64af06b..c5ce56e31 100644 --- a/docs/2-handbook/hives/dashboard.md +++ b/docs/2-handbook/hives/dashboard.md @@ -201,8 +201,7 @@ strip entries โ€” `๐Ÿ“Š stats`, `๐Ÿ–ฅ screen` when GUI is enabled, plus any agent-declared `dashboardLinks` extras), `status_text` / `status_set_at` (agent self-reported status โ€” the `(set N ago)` chip carries a `data-set-at` stamp and ticks every 30s to stay fresh across the long-lived keyed row -cache), `rate_limited`, `ctx_tokens` / `context_window_tokens` -(context-window badge data). hive-agent is the single source +cache), `rate_limited`. hive-agent is the single source of truth for all of these. The dashboard resolves each `AgentLink.kind` against a per-agent base URL depending on whether hive-gateway is in front (`StateSnapshot.gateway_enabled`, sourced from the @@ -225,8 +224,7 @@ as a unit. **When the container is stopped** (`ContainerView.running = false`), the dashboard skips the async `dashboard-state` fetch entirely (the agent web server is down), so a single badge replaces the badge chain, -the nav strip is empty, and status text / rate-limited / ctx -badges disappear. The agent icon goes straight to the dimmed +the nav strip is empty, and status text and the rate-limited badge disappear. The agent icon goes straight to the dimmed `/favicon.svg` fallback instead of attempting a doomed load from the container's URL. Static fields โ€” `pending_reminders`, `parent`, `config` link โ€” remain visible regardless of run state. @@ -258,7 +256,7 @@ start / stop / restart / rebuild / destroy). An agent can carry running alongside a `stop_for_update` on the same agent โ€” and each renders as its own independent badge instead of collapsing into one label, matching the existing multi-badge convention this -line already uses for `paused`/model/ctx. +line already uses for `paused`. Any pending badge means the row is actually **running** something right now (see **Pending-badge derivation** below); every row @@ -295,24 +293,6 @@ banner below is the only queued-work indicator on this tab, and it reads the narrow `/api/jobq/rollup` endpoint rather than the full graph. -**Active model badge** (`model ยท `, blue) appears when the -container is running and the harness has persisted a model name (the -`active_model` field of `hyperhive-harness.json`, the consolidated -harness state file in the agent's state dir). Read by hive-c0re's -`ContainerView` (`read_active_model`); absent until the agent has -completed at least one turn, and hive-c0re suppresses stale values -for stopped containers. - -**`ctx ยท Nk` chip** shows the agent's last-turn context size, -populated from `DashboardState.ctx_tokens` (absent until the -agent has completed at least one turn). The chip colour (green / -yellow / red) keys off `DashboardState.context_window_tokens` -(the real context window for the model the agent last ran on, -authoritative from the agent side); the badge goes yellow โ‰ฅ 50% -and red โ‰ฅ 75% of that window, matching the harness compaction -watermarks. When the window value is absent the badge falls back -to fixed 100k / 150k thresholds. - **Per-agent `โ‹ฎ` overflow menu** โ€” a `โ‹ฎ` button appears on the right edge of each container row. Selecting it opens a small dropdown with per-agent actions and navigation links. Contents: diff --git a/frontend/packages/dashboard/src/agents.js b/frontend/packages/dashboard/src/agents.js index 9344ba65e..d9e21b4da 100644 --- a/frontend/packages/dashboard/src/agents.js +++ b/frontend/packages/dashboard/src/agents.js @@ -13,17 +13,6 @@ import { containersState } from "./state.js"; import { closeAllMenus } from "@hive/shared/hive-menu.js"; import "./agent-menu/hive-agent-menu.js"; // registers โ€” side-effect import -// Context-window badge thresholds. Preferred source is each container's -// `context_window_tokens` from /api/state (the real window for the model -// it last ran on) โ€” thresholds are then 75% / 50% of it, matching the -// harness compaction watermarks (compact at 75%, auto-reset at 50%). The -// fixed token constants are the fallback for when that field is absent -// (agent has no turns yet, or no per-model config matched the model). -const CTX_WARN_FRACTION = 0.75; // >= this share of the window -> red -const CTX_CAUTION_FRACTION = 0.5; // >= this share of the window -> yellow -const CTX_WARN_TOKENS = 150_000; // fallback red threshold (~= 75% of 200k) -const CTX_CAUTION_TOKENS = 100_000; // fallback yellow threshold (~= 50% of 200k) - // โ”€โ”€โ”€ module-level state โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Keyed container row cache. Maps agent name -> { el:
  • , fingerprint }. @@ -239,7 +228,7 @@ function sortedContainerRows(containers) { // Serialise the visible state of a container row into a stable string // for change-detection. Includes everything that affects what the row // renders โ€” container fields, derived pending/selection state, and -// link-base context. The async dashboard-state (nav strip, ctx badge, +// link-base context. The async dashboard-state (nav strip, // status text) is intentionally excluded: it populates in-place and is // preserved when a row is reused. function containerRowFingerprint( @@ -255,7 +244,6 @@ function containerRowFingerprint( failed: c.failed, paused: c.paused, needs_login: c.needs_login, - active_model: c.active_model, port: c.port, pending, opRunning, @@ -349,7 +337,7 @@ function buildContainerLi(c, opts) { // Fetch the lean dashboard-state snapshot from the agent directly. // Populates: nav strip links (including the screen link that // c0re's disk-based build cannot detect), rate_limited badge, - // ctx-window badge, and self-reported status text. + // and self-reported status text. // Fails gracefully when the agent is starting up or the gateway // is not yet routing to it โ€” badges simply don't appear. // Only runs when the row is first built (fingerprint changed) โ€” @@ -396,32 +384,6 @@ function buildContainerLi(c, opts) { ), ); } - // ctx-window badge - if (ds.ctx_tokens != null) { - const k = Math.round(ds.ctx_tokens / 1000); - const win = ds.context_window_tokens; - const warn = win != null ? win * CTX_WARN_FRACTION : CTX_WARN_TOKENS; - const caution = - win != null ? win * CTX_CAUTION_FRACTION : CTX_CAUTION_TOKENS; - const ctxClass = - ds.ctx_tokens >= warn - ? "badge-ctx-warn" - : ds.ctx_tokens >= caution - ? "badge-ctx-caution" - : "badge-ctx-ok"; - const title = - win != null - ? `last turn context: ${ds.ctx_tokens.toLocaleString()} / ${win.toLocaleString()} ` + - `tokens (${Math.round((ds.ctx_tokens / win) * 100)}% of the window)` - : `last turn context size: ${ds.ctx_tokens.toLocaleString()} tokens`; - head.append( - el( - "span", - { class: `hive-pill-sm ${ctxClass}`, title }, - `ctxยท${k}k`, - ), - ); - } // -- agent status text (self-reported via set_status) --------- if (ds.status_text) { const nowUnix = Math.floor(Date.now() / 1000); @@ -470,7 +432,7 @@ function buildContainerLi(c, opts) { // (an absent `failed` โ€” an older backend โ€” is `undefined`, falsy, // so this degrades to the old single badge). `needs_login` is still // c0re-owned (reads auth sentinel files on the host). rate_limited / - // ctx / status_text are agent-owned and rendered by the async + // status_text is agent-owned and rendered by the async // dashboard-state fetch above. if (pending.length) { // One badge per pill โ€” an agent can carry several transients at @@ -540,19 +502,6 @@ function buildContainerLi(c, opts) { ), ); } - if (c.active_model) { - head.append( - el( - "span", - { - class: "hive-pill-sm badge-model", - title: `active claude model: ${c.active_model}`, - }, - c.active_model, - ), - ); - } - body.append(head); // Per-card action buttons (R3ST4RT / ST0P / ST4RT / R3BU1LD / @@ -671,7 +620,7 @@ export function renderContainers(s) { let li; if (cached && cached.fingerprint === fp) { // Row unchanged โ€” reuse the existing DOM node. The async - // dashboard-state (nav strip, ctx badge, status text) stays + // dashboard-state (nav strip, status text) stays // intact from the previous build, avoiding a redundant fetch. li = cached.el; } else { diff --git a/frontend/packages/dashboard/src/common.css b/frontend/packages/dashboard/src/common.css index 54799b90b..9157671bb 100644 --- a/frontend/packages/dashboard/src/common.css +++ b/frontend/packages/dashboard/src/common.css @@ -112,28 +112,6 @@ code { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 10%, transparent); } -/* Active Claude model badge on dashboard container rows. */ -.badge-model { - color: var(--blue); - border-color: var(--blue); - opacity: 0.8; -} -/* Context-window usage badges on dashboard container rows. */ -.badge-ctx-ok { - color: var(--green); - border-color: var(--green); - opacity: 0.85; -} -.badge-ctx-caution { - color: var(--amber); - border-color: var(--amber); - text-shadow: 0 0 6px color-mix(in srgb, var(--amber) 50%, transparent); -} -.badge-ctx-warn { - color: var(--red); - border-color: var(--red); - text-shadow: 0 0 6px color-mix(in srgb, var(--red) 50%, transparent); -} .badge-ok { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green);