feat(dash): show active model badge on agent cards (closes #2069)

Read the persisted model name from each agent's harness state file
(harness/hyperhive-model) and surface it as a small blue badge on
the container row in the SW4RM tab.

- container_view.rs: add `active_model: Option<String>` to
  ContainerView; populated by new `read_active_model` helper that
  reads harness/hyperhive-model; only set when container is running
  (stale model info from a stopped agent is misleading)
- container_view.rs: add active_model to ContainerView literal in
  host_stats test helper
- tabs.js: render badge-model chip after needs-update, before
  reminders; add active_model to the row fingerprint so re-renders
  fire on model change
- common.css: add .badge-model (blue, 80% opacity — informational)
This commit is contained in:
iris 2026-06-27 19:40:37 +02:00
commit 4375ab6246
4 changed files with 42 additions and 0 deletions

View file

@ -85,6 +85,11 @@ code {
color: var(--purple); border-color: var(--purple);
text-shadow: 0 0 6px color-mix(in srgb, var(--purple) 40%, 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);

View file

@ -521,6 +521,7 @@ window.marked = marked;
needs_login: c.needs_login,
needs_update: c.needs_update,
pending_reminders: c.pending_reminders,
active_model: c.active_model,
port: c.port,
pending,
opRunning,
@ -726,6 +727,12 @@ window.marked = marked;
));
}
if (c.active_model) {
head.append(el('span',
{ class: 'badge badge-model', title: `active claude model: ${c.active_model}` },
c.active_model));
}
if (c.pending_reminders && c.pending_reminders > 0) {
head.append(el('span',
{