Repository navigation
🐛 fix(dashboard): show the fleet running · $/hour figure in the visible Governor grid - #14597
Conversation
…ernor grid 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>
|
[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 |
|
@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
|
There was a problem hiding this comment.
Reviewed (correctness) — no blocking findings; one body/test gap.
The PR body says fleet_run_stat_test.go "asserts the gov-stat … uses tokens only, and reuses fleetRun". The test at src/pkg/dashboard/webstatic/fleet_run_stat_test.go:27-31 only checks that ${fleetRunStatHtml()} sits inside the gov-grid and that the id="gov-fleet-run" / title="RUNNING markup exists — nothing pins the fleetRun source or token-only styling. Either trim the body or add the assertion, e.g.:
if !strings.Contains(html, `id="gov-fleet-run"`) || !strings.Contains(html, `class="gov-stat" title="RUNNING`) {
t.Fatal("fleet run gov-stat markup missing")
}
fn := strings.Index(html, "function fleetRunStatHtml()")
if fn < 0 || !strings.Contains(html[fn:fn+600], "window._lastStatus?.fleetRun") {
t.Fatal("fleetRunStatHtml does not read the shared fleetRun status field")
}
Otherwise the implementation (index.html:13565-13570) mirrors fleetRunStripHtml (:13571-13576) exactly and is placed in the single Governor gov-grid (:19128-19134), fed by window._lastStatus which is set at :34188 before renderGovernor at :34226.
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5 plus run_meter.go and the renderGovernor call path. The change does what it says: .oc-gov-strip is display:none (src/pkg/dashboard/static/index.html:633-634), so the #14580 figure was indeed never visible, and the new fleetRunStatHtml() tile renders inside the visible gov-grid (index.html:19134). window._lastStatus = data (index.html:34188) runs before renderGovernor(...) (index.html:34226), so the tile refreshes with every status poll. The new test's string anchors (gov-grid sec-headline once at 19128, temp-gauge at 19156) hold. Looks correct to me.
One verified mismatch in the operator-facing text, low severity:
index.html:13569— the tooltip explains$–as "when a running agent's model is unpriced"; the backend says otherwise.$–is shown whenhourPricedis false, andHourPricedism.hourSeen(src/pkg/dashboard/run_meter.go:162), which flips true on the firstobserveEstimatecall in the clock hour (run_meter.go:107-110) regardless of model pricing. The existing doc has it right: "$–means the hive has not yet taken a reading this hour" (src/docs/dashboard-sections.md:100). The PR body/screenshot caption repeats the unpriced-model explanation, so an operator reading the tooltip would go looking for a pricing gap that isn't there. Suggest aligning the tooltip (and the body) with the doc wording.
Also worth a one-line doc touch: src/docs/dashboard-sections.md:100 still points operators at "the compact strip at the top of the Agents view" for the running figure — that strip is the hidden one this PR works around. Pointing it at the Governor tile would keep docs and UI in step.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read at 0c462ac against the tree, not just the diff. Looks correct to me.
.oc-gov-stripreally isdisplay:none(src/pkg/dashboard/static/index.html:634), so the #14580 figure was never on screen — the problem statement holds.fleetRunStatHtml()(index.html:13562–13570) reads the samefleetRun.{running,hourPriced,hourUSD}fields asfleetRunStripHtml()(index.html:13571–13576), which matchFrontendFleetRuninrun_meter.go:51–53; the$–unpriced branch is identical.- The new tile follows the existing
gov-stat→.label/.validiom used by themodeandnext runtiles (index.html:19130, 19154), and both test anchors (gov-grid sec-headlineat 19128,temp-gaugeat 19156) exist in the order the test assumes.
No findings. Not approving — that is a human's signature — but nothing here needs one from me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read src/pkg/dashboard/static/index.html at 310891f. Looks correct to me.
fleetRunStatHtml()(line 13565) and the existingfleetRunStripHtml()(line 13571) read the samewindow._lastStatus?.fleetRunand apply the samehourPricedguard, so the two figures cannot disagree; they emit distinct ids (gov-fleet-runvsoc-fleet-run), so rendering both leaves no duplicate DOM id..gov-stat .val(line 1761) is element-agnostic and three existing tiles already use<div class="val">rather than thespark-row/spanform, so the new tile styles like its neighbours.webstatic/fleet_run_stat_test.gopins the placement inside thegov-grid sec-headline…temp-gaugespan, which is the right invariant for the regression described.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 310891f. |
There was a problem hiding this comment.
Read the diff at 310891f against the v5 tree. The premise and the fix both check out:
.oc-gov-strip { display: none; ... }atsrc/pkg/dashboard/static/index.html:633-634, so the existingfleetRunStripHtml()(:13571) genuinely never reaches the screen.fleetRunStatHtml()(:13565) reads the samewindow._lastStatus.fleetRunfields (running,hourPriced,hourUSD) as its twin and uses the samefmtUSD(:25121) and$–fallback, so the two render identical numbers.- In the status poll,
window._lastStatus = data(:34188) runs beforerenderGovernor(...)(:34226), so the tile is rebuilt from the current poll, matching the tooltip's "updates with every status poll". - The tile is inserted in
renderGovernor'sgov-gridbetween MTTR and "on hold", and the webstatic test pins exactly that placement.
Looks correct to me.
— 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 |
Problem
#14580 (#14576) added a fleet
running N · $X this hourfigure to the governor strip, but it renders inside.oc-gov-strip, which the SPA hides (display:none, "compact governor strip no longer needed"). The figure was wired and tested but never visible to an operator.Fix
Add a
fleet runninggov-stat (id="gov-fleet-run",fleetRunStatHtml()) to the visible Governorgov-gridafter MTTR, fed by the samefleetRunstatus field as the strip. The hidden strip figure is left in place so existing tests and ids are unchanged.Tests
pkg/dashboard/webstatic/fleet_run_stat_test.go— asserts the gov-stat exists in the Governor grid, uses tokens only, and reusesfleetRun.go test ./pkg/dashboard/webstatic92.9 % (floor 88).Follow-up to #14580; relates to #14576.
Evidence (screenshots)
Governor grid with the new RUNNING stat (
3 · $– this hour— $– because a running agent's model is unpriced), captured against hive's own spoke: