Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-ag3nt/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
müde 5c6c607e25 agent badges: split into ctx (last-inference) + cost (cumulative)
the existing ctx badge was misnamed: it summed `result.usage`, which is
the cumulative tokens billed across every inference in the turn. for
tool-heavy turns that easily exceeds the model's context window (a 600k
cached prefix × 15 sub-calls = 9M cache_read), making it useless as a
"should i compact?" signal.

now two separate badges:

  ctx · N    last inference's prompt size = actual context window in
             use right now. parsed from each `assistant` event's
             `.message.usage`; the harness tracks the most recent one
             across the stream and snapshots it when the `result`
             event lands.

  cost · M   cumulative tokens billed across the whole turn (the
             previous behaviour, now correctly labelled).

both update via a single `TokenUsageChanged { ctx, cost }` SSE event at
turn-end. turn_stats grows four columns (`last_input_tokens`,
`last_output_tokens`, `last_cache_read_input_tokens`,
`last_cache_creation_input_tokens`) so the cold-load seed can paint both
badges on page load. migrations run try-and-ignore ALTERs so existing
agent dbs catch up; pre-migration rows have last-inference zeros and
yield no `ctx` seed (badge stays empty until next turn) rather than a
misleading 0.
2026-05-18 18:48:35 +02:00
..
bin agent badges: split into ctx (last-inference) + cost (cumulative) 2026-05-18 18:48:35 +02:00
client.rs retry hive socket up to 5x over 60s, surface retry count to claude 2026-05-16 15:28:18 +02:00
events.rs agent badges: split into ctx (last-inference) + cost (cumulative) 2026-05-18 18:48:35 +02:00
lib.rs turn_stats: per-turn analytics sink 2026-05-17 23:00:41 +02:00
login.rs refactor: per-agent state paths (/agents/{label}/state), centralize in paths.rs 2026-05-16 15:18:32 +02:00
login_session.rs login: default command is claude auth login 2026-05-15 13:32:51 +02:00
mcp.rs rename: open_threads → loose_ends + cancel_thread → cancel_loose_end across wire / tools / web ui 2026-05-18 18:24:09 +02:00
paths.rs refactor: per-agent state paths (/agents/{label}/state), centralize in paths.rs 2026-05-16 15:18:32 +02:00
plugins.rs add claudePluginsAutoUpdate NixOS option, default false 2026-05-17 02:59:51 +02:00
turn.rs agent badges: split into ctx (last-inference) + cost (cumulative) 2026-05-18 18:48:35 +02:00
turn_stats.rs agent badges: split into ctx (last-inference) + cost (cumulative) 2026-05-18 18:48:35 +02:00
web_ui.rs agent badges: split into ctx (last-inference) + cost (cumulative) 2026-05-18 18:48:35 +02:00