8000 feat(budgets): the assistant and agents answer where budgets stand by adeelahmad · Pull Request #645 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(budgets): the assistant and agents answer where budgets stand - #645

Merged
adeelahmad merged 1 commit into
mainfrom
claude/feature-list-batch-ds0y4v
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/feature-list-batch-ds0y4v

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: "where do my budgets stand?" had no answer in chat or over MCP. Budgets showed only in the top-bar meter and on the Costs page.

After: a read-only budgets tool, both in the assistant (its own "Costs and budgets" group) and over MCP. It lists each namespace the person can read with what it spent this period against its budget, what's left, and whether it's ok, near or over. Admins also see all of Lens against the overall budget, plus every other budget. The assistant's step reads like "Read budgets: all of Lens: $2.30 of $5 this month (ok); near or over: Digest".

How: budgets.overview builds on the same meter and status the Costs page uses. budgets.said writes the one-line summary.

Motivation and Context

Feature list Planned: "The assistant answers where budgets stand".

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added tests: test_budgets.py::test_agents_ask_where_budgets_stand (assistant tool and MCP; a namespace member sees only their namespaces; an admin sees all of Lens).
  • docs/budgets.md ("Asking the assistant or an agent"), docs/mcp.md, docs/assistant.md, README and docs/requirements.md updated.
  • Changelog fragment changelog.d/budgets-tool.md.

Done questions (AGENTS.md)

  • Goal: merges on green CI.
  • Agents: this is the agent surface (MCP budgets, assistant budgets).
  • Zero setup: nothing to install or configure.
  • Fewest clicks: one question in chat.
  • Configurable: it can be turned off like any assistant tool (disabled_tools).
  • Light: reads the existing budget rows; no new work in the background.
  • Private and secure: read-only, and limited to the namespaces the caller can read.
  • Cost: no model call of its own; it reads the ledger totals.
  • User decides: read-only; it changes nothing.
  • Upgrades: no stored data changes.
  • Honest: its figures are the ledger's own, with estimates labelled as on the Costs page.
  • Tests, docs updated; openapi unchanged.
  • Open standards: MCP.
  • Reported in the thread; refine later: forecasts from schedules (already in refine-later).
  • Reuse: budgets.meter and budgets.status.

Local checks: pytest tests/api/test_budgets.py tests/api/test_mcp.py tests/api/test_chat_tools.py (35 passed), ruff, mypy, ci/check_requirements.py.


Generated by Claude Code

A read-only budgets tool, in the assistant (its own Costs and budgets group)
and over MCP: what each namespace the person can read spent this period
against its budget, with what's left and ok, near or over; for admins also all
of Lens against the overall budget and every other budget. Built on the meter
and status the Costs page uses (budgets.overview), with a one-line summary for
the assistant's step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C8MJetfTHJzsWLEWwsh4kj
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad merged commit a5af7be into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/feature-list-batch-ds0y4v branch October 18, 2026 17:55
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

0