Repository navigation
✨ Live per-run cost · tokens · elapsed · tests · files line on agent cards - #14580
Conversation
…es line on agent cards While an agent is working, its card and the transcript pane header show $cost · tokens · elapsed · tests ✓/✗/– · N files, derived from the token collector's per-agent cumulative figures (delta since BusySince, baseline kept server-side so a reload does not reset it) and the test-runner / git summary lines already visible in the captured pane. The governor strip gains a fleet 'running N · $X this hour' tile. Fixes #14576 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Changelog fragment in the wrong directoryFragments live in git mv src/changelog.d/added-live-run-line.md changelog.d/added-live-run-line.md
git commit -s -m "changelog: move fragment to repo-root changelog.d/"See |
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 5120890. |
There was a problem hiding this comment.
Read run_meter.go against the things it leans on, not just the diff. The wiring is sound; one concrete blocker.
Blocker — changelog fragment is in the wrong directory. The fragment is at src/changelog.d/added-live-run-line.md, but the guard only compiles root changelog.d/ and refuses misplaced fragments rather than autofixing them (.github/workflows/changelog-fragment-guard.yml:181-189, "misplaced fragment — not autofixing"). That is the red changelog-fragment-guard check. Fix is the one the guard prints:
git mv src/changelog.d/added-live-run-line.md changelog.d/added-live-run-line.md
Verified correct:
applyRunMeterreadsproc.PaneLines(400)on acrux.Processsnapshot —src/crux/process.go:98-103is a plain read of the snapshot'spaneCapture, and the same builder already does this atstatus_builder.go:1102, so no new lock or tmux call per status build.tokens.EstimateFromSummary(...).ByAgentismap[string]ModelCost(src/pkg/tokens/pricing.go:331-349), so the per-agent baseline/delta andmodelCostTokenssum line up with what/api/costalready publishes — body's "no new telemetry" claim holds.- Negative deltas after a counter reset are clamped in both
run()andfleet(); baseline is re-snapshotted whenLastKickchanges, so a new kick never inherits the previous one's spend. fmtUSD/fmtTokensexist inindex.html; new CSS uses existing tokens only.
Nit, not a defect: the SPA comment says "the server reports the delta since the kick's BusySince", but applyRunMeter prefers LastKick and only falls back to BusySince (which is also what the test asserts). The comment is the thing that's wrong.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Second-round catch-up for #14340: the 7 v5 commits that landed after the main forward-merge (#14585 credit issue authors, #14583, #14579 merge gate follows live sentinel label / HumanApprover, #14580, #14571, #14427, #14428). Hand-resolved (16 files): - stagelabels/human.go: union of v6 Route.ManualMerge and v5 HumanApprover, ManualMergeRule, LaneReason. - config: v5 auto_merge.credit_issue_authors applied in review_config.go (v6 moved AutoMergeConfig there). - github/review_evidence*: v5 (blocked param, Notice = !blocked); sentinel_sweep.go keeps v6 adoption handling with the v5 one-line change. - automerge: linked-issue gate (v6 #14184 fallout) now seeds the v5 MergeCreditor's author cache so a merge-ready PR costs one issue GET; v5's lane-side decisionActions test dropped (v6 renders actions in stagelabels.DecisionActions). - dashboard/stage_tracker.go: v5 #14579 stageTrackerSentinel supersedes v6 #14053 (cleared label: alert off, findings still fill the tooltip). - dashboard/server.go: v5 FleetRun + v6 AdmissionLabels; index.html: v5 attention title + v6 "Hive end to end first" sort. - docs: v5 text with v6-only sentences re-applied; api-reference citations regenerated. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…ernor grid (#14597) fleetRunStripHtml landed in .oc-gov-strip, which is display:none, so the fleet figure from #14580 was never on screen. Render the same figure as a gov-stat in the Governor section and pin it with a webstatic test. Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Fixes #14576
What
While an agent is running, its card in the Agents view and the pinned header of its transcript pane now show a live run line:
$cost · tokens · elapsed · tests ✓/✗/– · files changedThe governor strip gains a
running N · $X this hourtile.How
pkg/dashboard/run_meter.go(new): a per-agent run meter that baselines the agent's cumulative estimated spend/tokens (the sametokens.EstimateFromSummaryfigures/api/costalready publishes — no new telemetry) the first time it sees a kick, and reports the delta while the kick's turn is unsettled. Test signal is parsed from the lastgo test/pytest/ jest / vitest result line in the pane transcript (–when none); files-changed fromN files changedsummary lines./api/status:agents[].run(omitted when idle) andfleetRun..oc-run-lineon the card and in.oc-agent-detail-header;#oc-fleet-rungovernor tile. CSS uses existing tokens only (var(--sp-*),var(--muted), status colours) — style ratchet passes.spend (range)row is unchanged.docs/api-reference.md,docs/dashboard-sections.md; changelog fragment.Tests
run_meter_test.go: baseline/reset per kick, idle → no line, LastKick preferred over BusySince, fleet hour figure, test-line parsing (go/pytest/jest, last line wins, ANSI stripped), files-changed parsing.Evidence
Screenshots to follow in a comment (card at t0 and t0+12s, transcript header, governor tile).
Evidence (screenshots)
Live run line on the scanner card, two captures one poll apart (elapsed advances 2m 28s → 2m 46s; $– because scanner's model is unpriced):
Transcript/terminal pane header with the pinned line:
Note: the governor-strip fleet figure landed inside the hidden
.oc-gov-strip; #14597 moves it into the visible Governor grid.