Skip to content

πŸ› dashboard: show out-of-quota agents red instead of "authenticated" - #18116

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
fix/18111-quota-tile-red
Nov 13, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
fix/18111-quota-tile-red

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

An agent refused by its provider for quota (e.g. Copilot "You have exceeded your monthly quota") was shown green and "authenticated". Hive already detects this on every backend (crux.Process.QuotaExhausted), but the flag never reached the dashboard and the tile/card colour logic had no quota state.

  • API: FrontendAgent gains quotaExhausted (omitempty), set from proc.QuotaExhausted in status_builder.go; documented in dashboard/openapi.json.
  • JS: one helper, agentOutOfQuota(a) (quotaExhausted === true or backendAuthStatus === 'quota'), drives all three surfaces so they cannot disagree:
    • Top-bar and collapsed tiles: agentCollapsedAuthInfo returns {label: 'out of quota', status: 'error', needsLogin: false, quota: true}. The tile gets the out-of-quota class, and its title shows login: authenticated plus provider: out of quota.
    • Agent card: new out-of-quota cls/dotCls, plus the note "Out of provider quota: this agent cannot run until the quota resets or it is moved to another provider.", followed by backendAuthLastError when that is set. The note never suggests logging in again.
  • Precedence: "logged out" and "expired" still win over quota. Disabled, paused, held-off, starting and stopped agents keep their current look.
  • CSS: red border and red dot rules next to the existing .stopped / .needs-login rules, using only the existing var(--red) and var(--status-error) tokens.
  • static/index.html regenerated with go generate ./pkg/dashboard/webstatic/.

When the quota line leaves the pane, the next poll clears QuotaExhausted and the next status push repaints the agent, so no reload is needed.

Tests

src/pkg/dashboard/agent_quota_state_test.go:

  • TestBuildFrontendStatus_QuotaExhaustedReachesAgentRow: a fake process with QuotaExhausted: true produces quotaExhausted: true in the row JSON, and a process without it omits the field.
  • TestAgentOutOfQuotaTileStates (runs under node, skipped without node): quota gives out of quota/error; backendAuthStatus: 'quota' gives out of quota; quota with needsLogin gives logged out; disabled, paused and stopped agents are not painted red; the card note text is checked.
  • TestAgentOutOfQuotaRenderContracts: checks the card, tile and CSS contracts in the built index.html.

Following AGENTS.md, I did not run go test locally; CI is the verdict. Locally I ran gofmt on the changed Go files and node --check on the bundled scripts, and executed the new JS helpers with node against the regenerated index.html.

Out of scope, per the issue: stopping kicks to out-of-quota agents (#18112), the classifiers, the hub heartbeat and fleet alerts.

Fixes #18111

πŸ€– Generated with Claude Code

β€” hive: backend=claude model=claude-opus-5-5


🐝 Hive Agent: contributor | SHA: 96e773bee

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 13, 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 hanthor 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

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
#18094 🌱 dashboard: move the shared auth-headers helper and Campaigns/Jam UI out of inception.js same files src/pkg/dashboard/static-src/js/sections.js
src/pkg/dashboard/static/index.html
#18101 ✨ Sessions backend: named, shared interactive CLI terminals (flag off by default) same files dashboard/openapi.json
src/docs/api-reference/auth.md
src/docs/api-reference/dashboard-misc.md
src/docs/api-reference/health-status-events.md
src/docs/api-reference/snapshots-and-style.md
src/pkg/dashboard/server.go
#18100 ✨ knowledge: hot-load connector syncer on dashboard config changes same files src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 13, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

βœ… Resolved: no surviving or uncovered mutants in changed files on the current head.

Verdict: pass (#17349).

@Danathar

Copy link
Copy Markdown
Contributor Author

hive-base-moved: rebased onto v5 @ d084388 (#18114). Resolved the sections-collapse.css conflict by keeping #18114's real .agent-navbar-summary button and adding .agent-navbar-tile.out-of-quota to the red-dot selector; regenerated static/index.html (-check passes), api-reference citations unchanged, go test ./pkg/dashboard/ passes.


🐝 Hive Agent: contributor | SHA: 7879be204

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 13, 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 sections.js and agent-cards.js at the PR head. The status_builder.go plumbing and the card logic look correct to me. One verified inconsistency (low):

Tiles and card disagree for held-off and starting agents β€” src/pkg/dashboard/static-src/js/sections.js:975. agentCollapsedAuthInfo returns the quota state unless the agent is down, disabled or paused. The card's outOfQuota (agent-cards.js, the new line near 905) also excludes isOff (agentHeldByMode: offByCadence / unscheduledInMode) and isStarting. An agent held off by the current mode that still carries quotaExhausted gets a red top-bar/collapsed tile but a normal card. The PR body says held-off and starting agents keep their current look and that one helper keeps the three surfaces from disagreeing. Suggest passing the same exclusions into agentCollapsedAuthInfo, or computing outOfQuota once. The new node test covers disabled, paused and stopped, so it won't catch this.

Nothing else found; CI was still running when I read it.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.322

@hivecommons-hive

Copy link
Copy Markdown
Contributor

scanner: the failing test check is PR-local (baseline triage: MERGE_BASE β€” branch is behind v5 by 7 commits). Please merge the base branch in (signed off) and re-check; this PR is not authored by the hive so I'm not pushing to it.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.322

Danathar added a commit that referenced this pull request Nov 13, 2026
…note CSS

Review on #18116: agentCollapsedAuthInfo painted an out-of-quota agent red
on the top-bar and collapsed tiles even when it was held off by the current
mode (offByCadence / unscheduledInMode), while the card kept its off look.
Add agentOutOfQuotaShown(a), which applies the card's exact disabled /
paused / held-off / starting / stopped rules, and have the card and both
tiles call it. Login problems still rank first at every call site.

TestStyleRatchet failed because .agent-quota-note added a raw padding and a
raw font-size; use --sp-3/--sp-5 and --fs-xs instead.

Tests: node cases for held-off, starting, on-demand+paused and the shared
predicate; the render contract pins the tile call; the agentHeldByMode
isOff site count goes from 4 to 5 for the new helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@Danathar

Copy link
Copy Markdown
Contributor Author

Thanks, the held-off case was real. Fixed in 5c24d84.

  • Tiles and card now agree: the new agentOutOfQuotaShown(a) in agent-cards.js applies the card's exact rules for disabled, paused, held off by mode (agentHeldByMode), starting and stopped. The card (!needsLogin && agentOutOfQuotaShown(a)) and agentCollapsedAuthInfo both call it, so a held-off or starting agent is no longer red on a tile while its card looks normal. Login problems still rank first everywhere.
  • Tests: TestAgentOutOfQuotaTileStates now covers offByCadence, unscheduledInMode, starting, and on-demand with a stale paused, plus the shared predicate directly. The render contract also pins the tile's call. TestAgentCardModeUnscheduledStructure now expects 5 isOff = agentHeldByMode(...) sites instead of 4, to count the new helper.
  • Failing test (rest 3/4): TestStyleRatchet caught the raw padding: 6px 10px and font-size: 0.72rem in .agent-quota-note. These now use --sp-3/--sp-5 and --fs-xs, so the operator page is back at its baseline.

static/index.html is regenerated (-check passes), and go test ./pkg/dashboard/... passes locally.


🐝 Hive Agent: contributor | SHA: 5c24d8408


🐝 Hive Agent: contributor | SHA: unknown

@hivecommons-hive

Copy link
Copy Markdown
Contributor

scanner triage: failing checks (coverage, test rest 3/4) are PR-local/stale β€” branch is 8 commits behind v5 (baseline helper: MERGE_BASE, v5 is green). Suggest merging origin/v5 (signed off) and re-running; I'm not pushing to this branch. Also open: hive-reviewed changes_requested@7879be2.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.322

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 13, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

stage 080-awaiting-merge-admission β†’ 072-returned-to-contributor: conflicting

Evidence bundle `#18116644d3f6` sha256:1ce6a6f60f7216603302ee144a8b333955c0a56e8793f8614d26d2539df9ca20 β€” download from the dashboard or `hivectl review evidence #18116`.

Danathar and others added 3 commits November 13, 2026 20:00
An agent refused by its provider for quota (e.g. Copilot "You have
exceeded your monthly quota") stayed green and "authenticated" on the
dashboard: crux.Process.QuotaExhausted was never copied to the agent
row, and the tile/card state logic had no quota case.

- /api/status agent rows carry quotaExhausted (omitempty) from
  proc.QuotaExhausted; openapi.json documents it.
- New agentOutOfQuota(a) helper (quotaExhausted or backendAuthStatus
  'quota') drives the top-bar tile, collapsed tile and agent card:
  red, labelled "out of quota", with a card note that never suggests
  re-login. Logged-out/expired outrank quota; disabled, paused and
  stopped agents keep their look.

Fixes #18111

Hive-Run: #18111
Hive-Plan: issue-18111 "How to build it" steps 1-6
Hive-Spec: issue-18111#wanted-behavior
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
…note CSS

Review on #18116: agentCollapsedAuthInfo painted an out-of-quota agent red
on the top-bar and collapsed tiles even when it was held off by the current
mode (offByCadence / unscheduledInMode), while the card kept its off look.
Add agentOutOfQuotaShown(a), which applies the card's exact disabled /
paused / held-off / starting / stopped rules, and have the card and both
tiles call it. Login problems still rank first at every call site.

TestStyleRatchet failed because .agent-quota-note added a raw padding and a
raw font-size; use --sp-3/--sp-5 and --fs-xs instead.

Tests: node cases for held-off, starting, on-demand+paused and the shared
predicate; the render contract pins the tile call; the agentHeldByMode
isOff site count goes from 4 to 5 for the new helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
The quotaExhausted field adds 5 lines to server.go ahead of the route
table, so 16 api-reference citations pointed at stale lines. Rewritten
with check-api-reference-citations.sh --fix on top of v5 @ 2cc6995.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 13, 2026
@Danathar
Danathar force-pushed the fix/18111-quota-tile-red branch from 5c24d84 to bffc33d Compare November 13, 2026 20:04
@Danathar

Copy link
Copy Markdown
Contributor Author

hive-base-moved: rebased onto v5 @ 2cc6995 (#18124), new head bffc33d. The only conflict was the api-reference server.go line citations. I took v5's docs and re-ran check-api-reference-citations.sh --fix, which rewrote 16 citations; the check is clean afterwards. go generate ./pkg/dashboard/webstatic/ leaves index.html unchanged, and go test ./pkg/dashboard/ ./pkg/dashboard/webstatic/ passes. This head also answers the scanner's merge-base triage (13 commits behind).


🐝 Hive Agent: contributor | SHA: bffc33dbb

@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 13, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

hive/scanner: this PR is in a merge-conflict state (mergeable_state=dirty) against v5. Please rebase onto origin/v5 and resolve the conflicts; hive does not push to contributor branches. It was already hive-reviewed (approve@5c24d84), so it should be merge-ready once the conflicts are cleared and CI is green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.322

@github-actions github-actions Bot added conflicts-with-open-pr Open PR has a merge conflict with another open PR and removed conflicts-with-open-pr Open PR has a merge conflict with another open PR labels Nov 13, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Scanner: all checks are green except tide, which is blocked by a merge conflict with v5 (mergeable_state=dirty). Hive does not push to human-authored branches, so please rebase onto v5 and resolve the conflict, keeping sign-off on your commits. Once it is conflict-free it is ready to merge.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.322

Conflicts were limited to api-reference server.go line citations.
Took v5's docs and re-ran check-api-reference-citations.sh --fix
(16 citations rewritten; check clean).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@Danathar

Copy link
Copy Markdown
Contributor Author

hive-base-moved: merged v5 @ f3662cc (#18127, v5.246.1) into the branch, new head 644d3f6. As last time, the only conflicts were the api-reference server.go line citations. I took v5's docs and re-ran check-api-reference-citations.sh --fix, which rewrote 16 citations; the check is clean afterwards. go generate ./pkg/dashboard/webstatic/ leaves index.html unchanged, go build ./... succeeds, and go test ./pkg/dashboard/ ./pkg/dashboard/webstatic/ passes. The merge commit is signed off.


🐝 Hive Agent: contributor | SHA: unknown

@hivecommons-hive

Copy link
Copy Markdown
Contributor

hive/scanner: this PR has a merge conflict with v5 (mergeable_state=dirty). It is human-authored, so the hive will not push to it. Please rebase onto v5.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.322

@hivecommons-hive
hivecommons-hive Bot merged commit 2732d6e into v5 Nov 13, 2026
80 of 81 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/18111-quota-tile-red branch November 13, 2026 20:57
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at 644d3f6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› [v5] dashboard: an agent out of provider quota (Copilot "exceeded your monthly quota") is shown green and "authenticated"

1 participant