Repository navigation
feat(costs): budget meter in the top bar and a Costs page - #275
Merged
Merged
Conversation
The top bar shows what the picked namespace (or all of Lens, for admins) spent against its budget, highlighted near or over, with a details popup for a day, week or month. A Costs page in the left menu shows spend by day, model and resource and sets the namespace's budget. Served by GET /api/v1/budgets/meter. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hw1quTxDYeSQsedKwZBNAw
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hw1quTxDYeSQsedKwZBNAw
…-p4a3fb # Conflicts: # CHANGELOG.md
…-p4a3fb # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hw1quTxDYeSQsedKwZBNAw
adeelahmad
pushed a commit
that referenced
this pull request
Oct 10, 2026
#275 merged, so it moves from "In progress" to the feature list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS
Merged
19 of 20 tasks
adeelahmad
pushed a commit
that referenced
this pull request
Oct 10, 2026
The budget meter (#275) and this PR both name the overall budget "all"; keep one constant (ALL) and the REF that accepts it, and check the meter shows it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbW6SC3MU2AmYQ9zFa5dk4
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.
Requested by Adeel · project thread
Description
Before: spend and budgets showed only inside a routine, pipeline, workflow or namespace's own page.
After: the top bar has a budget meter for the namespace picked in the switcher (follows it as it changes): "$1.20 / $5" with a bar, gold when near the budget's warn level, red when used up. It counts the budget's own period; without a budget it shows spend for the period you pick (day, week or month, remembered per browser). "All namespaces" shows all of Lens (admins), against the global budget once set. Clicking opens details: used and left, spend for day/week/month, top models, and a link to the new Costs page. Costs (new left-menu item after Reports) shows spend by day, by model, what cost most, by namespace (for all of Lens), the namespace's budget to set (admins), and every other budget's usage.
How:
GET /api/v1/budgets/meter?ns=&period=&detail=built on the activity ledger (activity.totals, newby_day,by_model,top(within=)). Namespace readers see its meter; all of Lens is admin-only. Also fixesactivity.topordering (the database didn't order grouped rows by cost, so the LIMIT could drop the most expensive ones).Motivation and Context
Adeel asked for a budget spend meter on the top right with a configurable period and a popup, and a dedicated Costs page in the menu.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01Hw1quTxDYeSQsedKwZBNAw
Generated by Claude Code