fix(dashboard): aggregate analytics across Hermes profiles - #21773
fix(dashboard): aggregate analytics across Hermes profiles#21773LeonSGP43 wants to merge 1 commit into
Conversation
|
Thanks for picking this up! Happy to test on my multi-profile setup once it lands. |
There was a problem hiding this comment.
Pull request overview
This PR fixes dashboard analytics undercounting by aggregating usage and model analytics across the default Hermes profile and named profile databases.
Changes:
- Adds profile
state.dbdiscovery for analytics. - Aggregates usage totals, daily rows, model totals, and skill summaries across profile databases.
- Adds regression coverage for multi-profile usage and model analytics aggregation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
hermes_cli/web_server.py |
Updates analytics endpoints to iterate over discovered profile databases and merge results. |
tests/hermes_cli/test_web_server.py |
Adds helpers and regression tests for analytics aggregation across default and named profiles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for db_path in _list_analytics_db_paths(): | ||
| db = SessionDB(db_path=db_path) |
| for db_path in _list_analytics_db_paths(): | ||
| db = SessionDB(db_path=db_path) |
|
Thanks for the focused multi-profile analytics work. Current main took a different profile-scoped direction, so this is not safe to salvage directly. Problems
Suggested changes
The linked issue was resolved by #25438 ( |
Summary
Closes #21705.
The analytics dashboard was reading only the active profile's
state.db, whichundercounted token usage, sessions, costs, and API calls for multi-profile
users. This change aggregates analytics across the default profile and named
profile databases for the usage and models endpoints.
What Changed
state.dbfiles once for dashboard analytics/api/analytics/usageresponse/api/analytics/modelsresponseScope Boundary
Verification
uv run --frozen python -m py_compile hermes_cli/web_server.py tests/hermes_cli/test_web_server.pygit diff --checkuv sync --frozen --extra alluv run --frozen ruff check .preexisting_unrelatedQuality Firewall Proof
local_proof_sha:ca2574cef1d1077e3596b4e8cf87d466b0f05b1egithub_pr_head_sha:TBD after pushworktree_path:/private/tmp/hermes-pr-HER-64-0ec0c564-6e80b26bbranch:fix/HER-64-issue-21705base_origin_main_sha:faa13e49f81480771ceeb55991bb0c27edf1a5fblatest_fetch_at:2026-05-08T08:09:34Zcommands: seeproof-input-ca2574cef1d1077e3596b4e8cf87d466b0f05b1e.jsonexit_codes: seeproof-input-ca2574cef1d1077e3596b4e8cf87d466b0f05b1e.jsonstarted_at:2026-05-08T08:07:33Zcompleted_at:2026-05-08T08:16:52Zlog_artifacts_or_inline_summary: seeproof-input-ca2574cef1d1077e3596b4e8cf87d466b0f05b1e.jsongatekeeper_audit_id:her61-20260508T080207Z-attribution-summary-11db70159baseline_attribution:preexisting_unrelatedrepair_mode:falseSubmission Note
Do not open or push this PR draft until Gatekeeper either:
11db7015986440698b6609e79fd08f9e41e49c2cto the current identical tree atca2574cef1d1077e3596b4e8cf87d466b0f05b1e, or