Repository navigation
feat(budgets): ask for an overall AI budget in setup, with soft and hard limits - #281
Conversation
…ard limits A new `all` budget caps everything Lens spends. The in-app setup wizard gets a Budget step and the web installer asks for one with a cloud provider: a scale for the hard limit, the soft limit at 80% (warns), the model's price so the spending is counted. At the hard limit runs wait or are skipped and priced model calls stop; local models keep working. The web installer now asks only the essentials, with folder/port/network under Advanced and the extras under More options on the review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XvwHFwvrDy4awJHkXCMaVe
|
One-line install failed at the step where the upgrade agent installs an upgrade the web app asks for (added in #260). The request was written to Generated by Claude Code |
…-nz53p7 # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbW6SC3MU2AmYQ9zFa5dk4
|
Merged current main into this branch (merge commit, no rebase): the only conflict was Generated by Claude Code |
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
…survey follows the installer A model on this machine or its network costs nothing, so the setup wizard asks for a budget only after a cloud model, as the web installer does. The clicks survey's install journey no longer waits for the Extras step (now More options on the review): one click fewer, recorded in the baseline. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XvwHFwvrDy4awJHkXCMaVe
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XvwHFwvrDy4awJHkXCMaVe
…-nz53p7 # Conflicts: # CHANGELOG.md # ci/clicks/baseline.json
…-nz53p7 # Conflicts: # ci/clicks/journeys.mjs
…-nz53p7 # Conflicts: # docs/get-started.md
…349) "Stay private and safe" now covers flagging instruction-like text (patterns or the optional local classifier, #329, #347), asking before the browser acts on what the assistant wrote (#333), breaking up links in chat-room answers (#338), the archive as data over MCP (#343) and the audit log of what was caught (#344). "See what it costs" adds the overall budget asked for in setup (#281). "In progress" drops what merged and adds #337, #341 and #346. Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
Requested by Adeel · project thread
Description
Before: neither setup wizard asked about spending. Budgets covered only single routines, pipelines, workflows or namespaces. The web installer had a separate Extras step and showed folder, port and network up front.
After: the in-app setup wizard has a Budget step, and the web installer asks for a budget when a cloud provider is picked. Both use a scale for a hard limit (none by default), with a soft limit at 80% that warns, and take the model's price so the spending is counted. More sets the soft limit, the period and what happens at the limit. At the hard limit, runs wait (or are skipped) and model calls that cost money stop with the reason. Local, unpriced models keep working. The web installer now asks only the essentials: folder, port, network and version sit under Advanced, and the optional extras sit under More options on the review.
How: a new
allbudget resource inbudgets.pysums all activity.budgets.hard_stop()(cached for 30 s) is checked inactivity.Call.__init__and raisesactivity.OverBudget.PUT /api/v1/setup/budgetsaves the budget andai.price_in/price_out, andGET /api/v1/setupshows it.LENS_SETUP_SETTINGSaccepts abudgetsection, which is how the installer passes its answers. The OpenAPI schema and client were regenerated withmake openapi.Motivation and Context
Adeel asked for the setup wizard to ask for a budget, as a scale or as soft/hard limits, and for wizards to ask only the minimum while everything stays configurable in Settings.
Screenshots
Installer AI model step with the spending limit, and the review with More options (checked in Chromium).
Steps to reproduce
GET /api/v1/budgetslistsallwithusd: 25, warn_at: 0.8.Types of changes
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01XvwHFwvrDy4awJHkXCMaVe
Generated by Claude Code