Skip to content

fix(budget): include per-profile budgets in status JSON - #142

Merged
nujovich merged 3 commits into
mainfrom
hermes/build/fix-hermes-telemetry-issue-70-budget-json
Oct 27, 2026
Merged

nujovich merged 3 commits into
mainfrom
hermes/build/fix-hermes-telemetry-issue-70-budget-json

Conversation

@nujovich

@nujovich nujovich commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Issue: #70

What: Adds the missing profiles section to the /budget JSON status output. _budget_json() in telemetry_cli.py now enumerates profiles seen in the last 30 days via db.list_profile_ids(since30) and emits each profile's budget verdict (or null) under result["profiles"], mirroring the existing cron_jobs and senders sections. Adds regression tests asserting the section is present, empty when no profiles exist, and populated with the correct scope/spent/limit when one does.

Why: PR #95 added the Profiles: section to the chat /budget status block and /budget set profile support, but the --json status output (telemetry_cli._budget_json) still omitted per-profile budgets. Any caller using hermes-telemetry budget --json saw global, cron, and sender budgets but no profiles, leaving the JSON surface inconsistent with the text block and with /budget forecast, which accepts the profile scope.

Milestones

  • Milestone 1 -- Add per-profile budgets to the /budget status JSON output (profiles section in _budget_json)
  • Milestone 2 -- Surface per-profile budgets in the standalone dashboard budget panel (serve.api_budget currently emits only global scopes)

How to test:

uv run --with pytest --with pyyaml pytest tests/test_telemetry_cli.py -q
uv run --with pytest --with pyyaml pytest tests/ -q

Manual smoke test: run hermes-telemetry budget --json and confirm a profiles object is present.

@nujovich

Copy link
Copy Markdown
Owner Author

All milestones complete. Ready for review when you are.

@nujovich
nujovich force-pushed the hermes/build/fix-hermes-telemetry-issue-70-budget-json branch from 16ba313 to f48b29c Compare October 27, 2026 13:43
nujovich and others added 3 commits October 27, 2026 17:37
The standalone budget panel rendered an Edit button on per-profile rows,
but api_budget_detail/api_budget_update only accept ALLOWED_SCOPES, so the
modal opened with an error. Gate the button on scope_id.

Also add the CHANGELOG entry, the ONBOARDING note on the JSON/dashboard
profile surfaces, and resync README test counts (747).
@nujovich
nujovich force-pushed the hermes/build/fix-hermes-telemetry-issue-70-budget-json branch from f48b29c to cf0f3d7 Compare October 27, 2026 16:39
@nujovich
nujovich marked this pull request as ready for review October 27, 2026 16:42
@nujovich
nujovich merged commit 11d8b38 into main Oct 27, 2026
8 checks passed
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.

1 participant