Skip to content

feat(usage): rank model activity and cost before pagination - #3847

Closed
tang-vu wants to merge 2 commits into
Osmantic:mainfrom
tang-vu:feat/usage-ranking-controls-20260908
Closed

tang-vu wants to merge 2 commits into
Osmantic:mainfrom
tang-vu:feat/usage-ranking-controls-20260908

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Why this matters

The Usage table can rank the entire filtered inventory by cost, requests, input/output tokens or model name before selecting a page. CSV export inherits the same ordering. Unknown/untracked costs remain last in either cost direction; source report objects are never sorted in place.

Overlap check

Searched open and closed upstream PRs by semantic keywords and changed production files, inspected related scopes, and refreshed latest PRs through #3842 before publication.

Changed surface: Usage.jsx.

#3043 isolates report failures; #3051 deduplicates actions; #3185 labels pagination; existing helper PRs test calculations. #3839 fixes CSV escaping in the same table but does not rank rows. Combined validation preserves both changes.

Regression and focused validation

Usage.test.jsx + Usage.history.test.jsx: 12 passed. A 12-model page fixture proves a formerly off-page high-usage row reaches page one, unknown costs stay last and the source array retains its order.

Tradeoffs, rollback and remaining validation

The default retains report order. Ranking changes presentation, not billing totals or price estimation. No external spreadsheet or live billing account was used. Revert restores fixed report ordering.

Batch integration and validation limits

All ten feature branches start independently from upstream main 21f4b3a6. Feature integration: 9b4005885390603b9473992fd41c12621214f746 on integration/feat-ten-20260908. No merge-order dependency within this batch. Suggested review order follows the numbered feature list, but each PR is useful independently.

Also validated these features together with preceding fixes #3833–#3842 on combined integration 155e728a045e20a40eedba2893308199663faa85 (integration/feat-and-fixes-20260908 on tang-vu/DreamServer): 270 UI tests and 103 related API tests passed, plus real Fish and healthcheck boundary tests. Production files merged cleanly; the Makefile conflict was resolved by retaining all five standalone test registrations. This includes the invite refresh, CSV escaping, workflow pagination and healthcheck error-body fixes where files overlap.

Feature-only dashboard testing initially passed 265 tests; the subsequent storage-quota test passed in the 12-test Extensions suite and final 270-test combined run. Dashboard lint/build, CI-equivalent Ruff, shell/Python syntax, platform smoke and installer simulation passed. Local make gate is NOT green: the existing Hermes max_tokens contract fails on unchanged main too. BATS: 408 passed, 10 failed in AMD text fixtures, WSL dispatch and root-sensitive installer tests, reproducing the preceding baseline. Pre-commit gitleaks/size/shell hooks passed; private-key detection still flags the two unchanged dummy-key test fixtures. No fixture exclusions were added. Linux/WSL tests and mocked transports do not establish live hardware, migration or provider behavior.

Final review follow-up: dfd62230 also treats missing/unrecognized Usage cost provenance as unknown. Latest feature integration is 333b4adfc3ca4fed08b50b17ff4fb2b2efddc781; latest combined integration is f74ddbc317bb72e2d41bade6fb22d73c962f16bd. The affected 13-test Usage/history/CSV suite and dashboard lint passed on that combined head; the 270-test full UI receipt above is bound to its stated predecessor.

GitHub checks completed for candidate dfd62230a3cd9b38630aa627ebf65b7781b22a85: 28 successful checks, 4 conditionally skipped review checks, zero failed or pending checks. All scheduled technical CI checks passed. Local baseline and live-validation limits above still apply.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. We're closing outside-contributor pull requests that have had no activity for 14 days or more, so the queue reflects work that can still land. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and reopen it or open a focused PR. See #7253 for details and the contribution policy.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants