Skip to content

✨ Live per-run cost · tokens · elapsed · tests · files line on agent cards - #14580

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
feat/live-run-line
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
feat/live-run-line

Conversation

@clubanderson

@clubanderson clubanderson commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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 changed

The governor strip gains a running N · $X this hour tile.

How

  • pkg/dashboard/run_meter.go (new): a per-agent run meter that baselines the agent's cumulative estimated spend/tokens (the same tokens.EstimateFromSummary figures /api/cost already 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 last go test / pytest / jest / vitest result line in the pane transcript (– when none); files-changed from N files changed summary lines.
  • /api/status: agents[].run (omitted when idle) and fleetRun.
  • SPA: .oc-run-line on the card and in .oc-agent-detail-header; #oc-fleet-run governor tile. CSS uses existing tokens only (var(--sp-*), var(--muted), status colours) — style ratchet passes.
  • Existing spend (range) row is unchanged.
  • Docs: docs/api-reference.md, docs/dashboard-sections.md; changelog fragment.

Tests

ok  github.com/hivecommons/hive/pkg/dashboard            coverage: 87.7% (floor 84)
ok  github.com/hivecommons/hive/pkg/dashboard/webstatic  coverage: 92.9% (floor 88)

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):

agent card t0 agent card t1

Transcript/terminal pane header with the pinned line:

transcript header

Note: the governor-strip fleet figure landed inside the hidden .oc-gov-strip; #14597 moves it into the visible Governor grid.

…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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Changelog fragment in the wrong directory

Fragments live in changelog.d/ at the repository root, not under src/. Files under src/changelog.d/ are never compiled into CHANGELOG.md, so the changelog-fragment-guard check fails. Move them and push:

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 changelog.d/README.md (#5675, #11919). This comment is removed automatically once nothing is misplaced.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@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.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#14579 🐛 fix(dashboard): merge gate follows live sentinel label and honors human decisions same files src/pkg/dashboard/static/index.html
#14524 ✨ feat(hub,agent): Hub-coordinated live CLI session pool for multi-tenant runner capacity same files src/docs/api-reference.md

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@hivecommons-hive
hivecommons-hive Bot merged commit 7f3fa67 into v5 Oct 27, 2026
81 of 87 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/live-run-line branch October 27, 2026 15:09
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#145805120890` sha256:76b3711544e8ee8e99e773be70b29c91c8c4b03fc684755f4f39ca9ace6db7ec — download from the dashboard or `hivectl review evidence #14580`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 5120890.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • applyRunMeter reads proc.PaneLines(400) on a crux.Process snapshot — src/crux/process.go:98-103 is a plain read of the snapshot's paneCapture, and the same builder already does this at status_builder.go:1102, so no new lock or tmux call per status build.
  • tokens.EstimateFromSummary(...).ByAgent is map[string]ModelCost (src/pkg/tokens/pricing.go:331-349), so the per-agent baseline/delta and modelCostTokens sum line up with what /api/cost already publishes — body's "no new telemetry" claim holds.
  • Negative deltas after a counter reset are clamped in both run() and fleet(); baseline is re-snapshotted when LastKick changes, so a new kick never inherits the previous one's spend.
  • fmtUSD / fmtTokens exist in index.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

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

clubanderson added a commit that referenced this pull request Oct 27, 2026
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>
hivecommons-hive Bot added a commit that referenced this pull request Oct 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Live per-run cost · tokens · elapsed · tests · files line on agent cards and the transcript pane

1 participant