fix(dashboard): derive accepted/drafted totals from the per-depth arrays - #490
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
… arrays `_metrics_envelope` emits accepted_by_depth and drafted_by_depth but not the flat accepted_drafts and drafted_tokens, so the Per-depth acceptance subtitle rendered "— accepted of — drafted" and the Drafted / verify call tile rendered 0.00 tok/call with "0 drafted", even though the per-depth bars beside them had real numbers to draw (issue youssofal#401). Both surfaces now total the arrays they already receive, through a shared depthTotal helper that still prefers a flat total if the envelope ever carries one. The Recent requests WHEN column is left alone: no metrics row persists a completion timestamp, so rendering it is a server-side contract change rather than a dashboard fix. The committed _static bundle is rebuilt from the changed sources; the CSS asset hash is unchanged, so only the JS chunk moved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Per-depth acceptance subtitle and the Drafted / verify call tile read
accepted_draftsanddrafted_tokens, which_metrics_envelopedoes not emit — it emitsaccepted_by_depthanddrafted_by_depth. Both surfaces therefore rendered— accepted of — draftedand0.00 tok/callwhile the bars beside them drew real per-depth numbers.Both now total the per-depth arrays they already receive, through a shared
depthTotalhelper. The helper still prefers a flat total, so nothing changes if the envelope later carries one.This is the aggregate half of #401. The Recent requests
WHENcolumn is deliberately untouched: no metrics row persists a completion timestamp (thelast_metricsentries carry durations only), so a relative time needs a new field on the envelope and on its request-log row — a server-side contract change rather than a dashboard one.Verification
bun run typecheck(tsc --noEmit): clean.bun run build(tsc -b && vite build): success. The rebuiltmtplx/dashboard/_staticis included here; the CSS asset hash is unchanged (index-ZaQvA7xU.css), so only the JS chunk moved.python -m build: it carriesassets/index-CUmjZF08.jsand no longer carries the staleindex-CjL8TS30.js.bun: per-depth arrays only gives13 verify calls · 23 accepted of 36 draftedand2.77 tok/call; an emitted flat total still wins; empty or absent arrays give—and0 drafted · 0 verifies.python -m build: success (mtplx-2.11.2).python -m pytest tests/test_no_mlx_imports.py tests/test_runtime_kpis.py: 13 passed, 8 failed, and all 8 failures are Windows-only artifacts (nomlx;mtplx/thermal.pyimportspwd, which does not exist on Windows). The diff changes no.pyfile.tests/test_public_cli.pycannot be collected on Windows at all (os.geteuid), and CONTRIBUTING'sscripts/fresh_venv_smoke.shexpects a POSIX venv layout ($VENV/bin/python), so neither ran here.git diff --check: clean.Benchmark Evidence
Not applicable — this changes dashboard rendering only, not the runtime path.