Commit graph

387 commits

Author SHA1 Message Date
müde
0e2d26304e path linkify: require last segment to look like name.ext (skips dir refs) 2026-05-17 23:32:37 +02:00
müde
9585edef9b todo: rewrite harness-state split — /agents/<n>/{state,harness}, kill legacy /state 2026-05-17 23:30:28 +02:00
müde
bcb3f580ff todo: split harness-internal state from agent-visible /state 2026-05-17 23:28:59 +02:00
müde
d890509be3 docs: turn_stats sink + event-driven agent badges + dashboard event vocabulary 2026-05-17 23:28:34 +02:00
müde
e772182724 path linkify: skip trailing-slash (directory) matches 2026-05-17 23:25:51 +02:00
müde
2ad5a94897 dashboard: msgrow flex layout — fix per-char wrap when paths linkify 2026-05-17 23:20:29 +02:00
müde
c2c475bd65 events_vacuum: drop row cap, age-only retention (7d min) 2026-05-17 23:19:08 +02:00
müde
8f5752980f turn_stats: per-turn analytics sink
new sqlite table at /state/hyperhive-turn-stats.sqlite on each
agent's state dir. one row per claude turn captures identity
(model, wake_from, result_kind), timing (started/ended_at,
duration_ms), cost (input/output/cache_read/cache_creation token
counts), behaviour (tool_call_count + per-tool breakdown JSON),
and post-turn snapshot metrics (open_threads_count,
open_reminders_count).

wire additions:
- AgentRequest/ManagerRequest::CountPendingReminders +
  Broker::count_pending_reminders_for(agent)
- Bus::observe_stream + take_tool_calls — pumps the existing
  stdout stream-json, picks out tool_use blocks, accumulates per
  turn. bin loops fold the breakdown into each row.
- TurnStats::open_default + TurnStatRow + record() — best-effort
  inserts; failures log + don't block the harness.

both ag3nt and m1nd bins capture started_at + duration via
Instant::elapsed, fetch open-thread + reminder counts from
hive-c0re via the existing socket (post-turn, best-effort), and
record one row at turn_end. record_kind splits ok / failed /
prompt_too_long; failures carry the error message in note.

todo entries for host-side vacuum sweep + reading the table back
into agent/dashboard badges.
2026-05-17 23:00:41 +02:00
damocles
dc1ce1f236 open_threads: new get_open_threads MCP tool on agent + manager surfaces 2026-05-17 22:52:08 +02:00
damocles
9ec0d60308 flake: update nixpkgs + nixpkgs-unstable 2026-05-17 22:52:08 +02:00
müde
39d8359c10 agent ui: event-driven status / model / token_usage / turn_state
new LiveEvent variants on the per-agent bus —
status_changed / model_changed / token_usage_changed /
turn_state_changed — replace the per-agent web UI's
/api/state polling for the badge row.

emit sites:
- Bus::set_model → model_changed
- Bus::record_usage → token_usage_changed
- Bus::set_state → turn_state_changed
- turn::wait_for_login → status_changed("online") on creds detect
- post_login_start / post_login_cancel → status_changed("needs_login_*")

per-agent endpoints (post_set_model / post_compact / post_new_session
/ post_cancel_turn / post_login_*) now all return 200; client
drops the post-submit refetch except on login transitions, which
still need /api/state to render the OAuth form + session stream.

client adds dispatch on the four new event kinds, threads
`currentLabel` through so the composer re-enables on a live
status flip, and no longer fires refreshState() from turn_end or
postModel — the events carry the same signal faster.

closes the per-agent half of the dashboard event-channel
refactor; TODO entry dropped.
2026-05-17 22:49:55 +02:00
müde
b444dac6e8 agent ui: consolidate status into state-row badges
drop the "● harness alive — turn loop running" paragraph; the
new #alive-badge chip in the state row carries the same signal
across all statuses (loading / online / needs-login / offline)
with colour coding. token-usage chip renamed + restyled as
#ctx-badge — primary number is total context-window tokens
used, mirroring claude code's "N tokens" indicator.

every state-row badge now has hover detail: state-badge gets
per-state tooltips + age suffix, model-chip explains the
/model command, last-turn shows the raw ms duration, ctx-badge
breaks out input / cache_read / cache_write / output.

new todo entry for the per-turn stats sink (start/end/model/
tokens/tool-call-count) the harness should be writing.
2026-05-17 22:36:02 +02:00
müde
85c0df2e64 harness: enable nix-command + flakes for all agents 2026-05-17 22:24:24 +02:00
damocles
15f141801b limits: raise message body cap 1k → 4k (catches ~95% of conversational overflow) 2026-05-17 22:15:25 +02:00
damocles
0adce04a04 todo: harness ergonomics wishlist (auto-attach oversize / inbox batching / self-cancel / whoami / reply-to) 2026-05-17 22:14:49 +02:00
müde
e3b5837378 todo: security section — privsep + state-file hardening 2026-05-17 22:13:18 +02:00
müde
b3970c439c todo: drop landed-dashboard comments 2026-05-17 22:10:32 +02:00
müde
1db6b8ffed dashboard: queued reminders surface
new 'qu3u3d r3m1nd3rs' section between approvals and operator
inbox. lists every pending reminder with agent, due-relative
timestamp, body, payload path (path-linkified), and a cancel
button. drives off a new /api/reminders endpoint and a
POST /cancel-reminder/{id} that hard-deletes the row.

failure surface (last_error / attempt_count + retry) deferred —
needs a sqlite migration; tracked in TODO.md.
2026-05-17 22:10:02 +02:00
müde
cb71a07300 dashboard: clickable file-path previews
agents constantly emit pointer strings to /agents/<n>/state/foo.md
since broker bodies cap at 1 KiB. now those tokens linkify in the
message flow, question bodies, answer text, and operator inbox;
clicking expands an inline <details> that lazy-fetches via the
new /api/state-file?path=... endpoint.

endpoint allow-list: per-agent state dirs + shared docs, both
in their container-mount form (/agents/<n>/state, /shared) and
host form (/var/lib/hyperhive/...). 1 MiB read cap; canonicalises
before the prefix check so `..` / symlinks can't escape.

legacy bare `/state/...` is deliberately not matched — ambiguous
from the host's perspective (we'd need to know which agent the
message references to translate). agents should use the qualified
form going forward.
2026-05-17 22:08:15 +02:00
müde
a15fafb5de dashboard: surface peer questions + operator override
questions pane now shows both operator-targeted threads
(target IS NULL) and agent-to-agent threads (target = some
agent). filter chips above the list: all / @operator / @peer /
per-participant. peer rows get a mauve left rule + a 0V3RR1D3
button that POSTs the same /answer-question endpoint
(OperatorQuestions::answer already permits the operator as
answerer on any target).

wire changes: OperatorQuestions gains pending_all +
recent_answered_all; QuestionAdded + QuestionResolved events
carry target: Option<String>; emit sites drop their
target.is_none() guard. answered-history rows show the
answerer prefix so override answers are auditable at a glance.
2026-05-17 22:06:53 +02:00
müde
e7ce35c503 phase 6: container events + drop the 5s /api/state poll
new DashboardEvent::ContainerStateChanged + ContainerRemoved
close the last refetch loop on the dashboard. Coordinator's
rescan_containers_and_emit diffs a fresh container_view::build_all
against a cached last_containers map and fires per-row events.
called from actions::approve (post-spawn), actions::destroy,
the lifecycle_action wrapper, auto_update::rebuild_agent, and
the existing 10s crash_watch poll.

ContainerView extracted to its own module so coordinator and
dashboard can both build it. dashboard endpoints flip to 200;
container-lifecycle forms carry data-no-refresh. client drops
the periodic poll entirely — initial cold load + SSE for
everything afterwards. pending overlay reads from the existing
transientsState since the new event payload doesn't carry it.

PURG3 + meta-update keep the post-submit refetch since
tombstones + meta_inputs aren't event-derived yet; tracked in
TODO.md.
2026-05-17 22:01:15 +02:00
damocles
f153639cb4 readme: aggressive cut — depth lives in docs/, readme is the hook 2026-05-17 14:47:43 +02:00
damocles
61f296fc83 readme: voice pass — opener hook, why-this-exists framing, section breaks 2026-05-17 14:46:46 +02:00
damocles
c423ce9e39 todo: lock down get_open_threads scope (asker + target questions) 2026-05-17 14:43:08 +02:00
müde
e4438d1a6e todo: phase 6 event-covered redirects converted 2026-05-17 14:27:03 +02:00
müde
f559441a06 dashboard: /approve, /deny, /answer-question, /cancel-question, /request-spawn return 200; matching forms opt out of refetch 2026-05-17 14:26:53 +02:00
müde
d8d393da6d docs: dashboard event channel, hive-fr0nt crate, mutation events, seq dedupe 2026-05-17 14:24:47 +02:00
müde
62784d4933 todo: prune resolved items 2026-05-17 14:22:47 +02:00
müde
88a1f4c146 todo: mark phase 5b done; note remaining phase 6 conversions now unblocked 2026-05-17 14:21:12 +02:00
müde
7956e1c627 dashboard: transient_set / transient_cleared mutation events + client derived state 2026-05-17 14:20:51 +02:00
müde
1879b2f485 dashboard: question_added / question_resolved mutation events + client derived state 2026-05-17 13:33:02 +02:00
müde
56d615b51f dashboard: approval_added / approval_resolved mutation events + client derived state 2026-05-17 13:30:25 +02:00
damocles
291f1fce42 todo: clickable file paths in dashboard message bodies 2026-05-17 13:20:33 +02:00
damocles
82b0877c47 ask: rename ask_operator → ask + optional 'to' for agent-to-agent Q&A 2026-05-17 13:20:32 +02:00
müde
87f8f8a123 todo: phase 5b — mutation events for approvals/questions/transients 2026-05-17 13:15:32 +02:00
müde
b60774a66c events: LiveEvent::Note becomes struct variant so serde can actually serialize it 2026-05-17 13:14:09 +02:00
müde
aa24080f7b agent: /send returns 200 (terminal + turn-end refresh already cover the visual update) 2026-05-17 12:41:37 +02:00
müde
616ca38199 dashboard: /op-send returns 200; client relies on SSE for visual update 2026-05-17 12:41:04 +02:00
müde
a478792914 dashboard events: unified coord channel + /dashboard/{stream,history}; broker forwards 2026-05-17 12:39:48 +02:00
müde
d48cee7c2d approvals: ship raw diff text instead of pre-rendered html; client classifies per-line 2026-05-17 12:30:45 +02:00
müde
fb669c17c8 dashboard: derive operator inbox from message stream (drop snapshot field + refetch workaround) 2026-05-17 12:28:04 +02:00
müde
1340a654e7 sse: seq plumbing + subscribe-first dedupe dance 2026-05-17 12:26:00 +02:00
müde
8c186d4fb7 dashboard: msgflow uses shared terminal + backfill via /messages/history 2026-05-17 11:56:29 +02:00
müde
f27108aecf agent: route terminal scroll+backfill+SSE through hive-fr0nt::TERMINAL_JS 2026-05-17 11:53:50 +02:00
müde
0b9e7cbcf6 css: extract terminal pane styles to hive-fr0nt::TERMINAL_CSS 2026-05-17 11:50:39 +02:00
müde
e283e39949 css: route palette + body typography through hive-fr0nt::BASE_CSS 2026-05-17 11:47:45 +02:00
müde
7fc3e81062 hive-fr0nt: scaffold shared frontend-assets crate 2026-05-17 11:46:37 +02:00
damocles
1770b51845 manager mcp: expose 'remind' tool sharing storage helper with agent surface 2026-05-17 11:43:14 +02:00
damocles
0e6bac8388 limits: unified 1 KiB cap on send/ask + reminder auto-file on overflow 2026-05-17 11:36:12 +02:00
damocles
753409a5ef reminder: fix symlink escape + db bloat cap + handler consistency 2026-05-17 11:26:59 +02:00