Repository navigation
Rebuild provider dashboard as a fleet-ops console - #279
Conversation
Replace the "We're rebuilding this page" placeholder at /providers with a
detailed, modular fleet-operations dashboard for providers.
- Fleet health strip: plain-language verdict + segmented capacity bar + money KPIs
- Aggregated, deduped attention feed; every issue carries a concrete fix
(copyable command, in-app link, or guidance) enforced by a test
- Rich per-machine cards: EARNING / NOT EARNING hero verdict with the why +
fix inline, hand-built live gauges (thermal, memory, CPU, concurrency,
decode TPS, GPU memory), models, earnings/reputation, and expandable
backend slots + a vertical attestation chain with live Apple Root CA verify
- One routing deriver feeds the strip, feed, and cards so they never disagree
- Fetches the same-origin /api/me/{providers,summary} proxy routes
- Handles onboarding, offline, never_seen, untrusted, degraded, blocked, and
missing-live-metrics states gracefully
- Modular package (~32 single-responsibility files) replaces the 722-line
monolith; thin ProviderDashboardContent shim keeps the page import stable
- Tests: routing, fixes↔warnings contract, aggregate, format + full-page
render tests (healthy / problem fleet / onboarding); 211 vitest pass,
eslint clean, next build green
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR adds a provider dashboard UI and associated tests; none of the changed files match any Trust boundaries touchedNo existing TB is directly modified. The new dashboard components are read-only UI that consumes coordinator API data already protected by TB-001 and TB-004. New attack surface not covered by the threat modelTwo areas warrant a threat model update rather than a security finding, but engineering should be aware:
SEC-* findings resolvedNone — this PR does not touch any open-finding file paths. RecommendationIf 🔐 Threat model: |
| import { | ||
| formatUSD, | ||
| formatNumber, | ||
| abbreviateNumber, | ||
| maskSerial, | ||
| shortModelName, | ||
| pct, | ||
| clampPct, | ||
| formatTps, | ||
| humanizeUptime, | ||
| } from "@/app/providers/dashboard/format"; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b02758799
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| untrusted: { | ||
| kind: "command", | ||
| label: "Restart & re-link", | ||
| command: "darkbloom restart && darkbloom login", |
There was a problem hiding this comment.
Replace unsupported restart command
For the dashboard fixes that surface a copyable restart action, darkbloom restart is not a valid provider CLI subcommand: the CLI registers Start, Stop, Status, Doctor, Models, Local, Login, Logout, Benchmark, Update, Verify, Enroll, Unenroll, Logs, Report, and AutoUpdate in provider-swift/Sources/darkbloom/Darkbloom.swift, and the existing diagnostic guidance uses darkbloom stop && darkbloom start for a re-register restart. Users following these new fixes for untrusted/stale/crashed machines will copy a command that fails before recovery (and before darkbloom login in this case).
Useful? React with 👍 / 👎.
| value={clampPct(headroom)} | ||
| colorClass="bg-accent-brand" | ||
| height="h-1" | ||
| label={`Token budget ${abbreviateNumber(s.active_tokens)} of ${abbreviateNumber(s.max_tokens_potential)}`} |
There was a problem hiding this comment.
Use the provider-reported token budget
When Swift providers report active_token_budget_max, coordinator admission uses the provider-reported active_token_budget_used + queued_token_budget <= active_token_budget_max path in freeMemoryAdmits, not active_tokens/max_tokens_potential. This panel labels the legacy active/max-potential counters as the token budget, so queued reservations are omitted and idle slots with available budget can have the headroom bar hidden entirely, giving operators the wrong view of why a machine can or cannot accept more work.
Useful? React with 👍 / 👎.
| const groups = new Map<string, AttentionGroup>(); | ||
|
|
||
| for (const p of providers) { | ||
| const warnings = computeWarnings(p, ctx); |
There was a problem hiding this comment.
Normalize nullable provider model lists
The coordinator's myProvider.Models field is a Go slice without omitempty, so persisted or live providers with no models can be serialized as "models": null. This new dashboard now runs every provider through computeWarnings, which dereferences p.models.length, so any linked/never-seen machine whose stored model list is still nil will crash the whole /providers page before rendering the onboarding or machine cards. Normalize models to [] after parsing, or make the warning logic tolerate null.
Useful? React with 👍 / 👎.
Summary
Replaces the "We're rebuilding this page" placeholder at
/providerswith a detailed, modular fleet-operations dashboard. Frontend-only — no backend or protocol changes; uses data already exposed by/v1/me/providersand/v1/me/summary.The dashboard answers, at a glance, the three questions a provider has:
×N machineschips that scroll to the card) + per-machine cards whose hero verdict is the load-bearing verb EARNING / NOT EARNING.darkbloom start, reinstall, restart…), an in-app link (setup / models / payouts), or guidance — surfaced right next to the problem.Highlights
routing.ts) feeds the fleet strip, the attention feed, and each machine card, so the glance, the list, and the detail can never disagree.@/lib/cert-verify./api/me/providers+/api/me/summary(forwarding the Privy bearer token) — avoids CORS and keeps the coordinator URL server-side.src/app/providers/dashboard/replace the 722-line monolith; a thinProviderDashboardContentshim keeps the page import stable (mirrors thesrc/components/api-keys/pattern).Testing
routing,fixes↔warningscontract (every warning id must have a fix),aggregate(dedup / sort / fleet verdict / no false all-clear),format, plus full-page render tests (healthy fleet, mixed problem fleet, onboarding).eslint src/clean,next buildgreen.Quality gate
Reviewed by independent correctness and design/UX/a11y agents; applied their fixes (dark-mode pill contrast, card borders, focus-visible rings +
aria-pressed,tabular-nums, copy-command overflow safety, update-chip wired to latest version, "earning now" counts degraded machines).Preview
cd console-ui && npm run dev, then open/providers.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.