Repository navigation
feat: activity history, costs and budgets - #114
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT
…nd routine runs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT
…ff by default) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT
…st and budget in views Budgets are off unless set. Before a routine run or a job, Lens estimates the next run from the last 30 days and holds, skips or lets the assistant weigh a run that would go over. Held runs wait for a person to pick. Lists and detail pages show spend (≈ marks estimates) and budget state. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT
5 of 8 tasks
Jev's call keeps its ledger row around main's shared _system_one; spoken answers go through speech.speak with a model.speech row. A held routine run is released only after its run is asked for, so a routine that is running stays held.
This was referenced Oct 4, 2026
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.
Before: Lens had no way to see what a resource cost or did over time. Nothing could cap what a routine, pipeline, workflow or namespace spends.
After: every incoming request, outgoing call (models, embeddings, decisions, speech, notifications, tool HTTP), change and run is written to one activity ledger. Each entry is tagged with the resources it counts for.
Budgets are off unless set. A budget can cap USD and/or tokens per run, day, week or month. Before a routine run or a job, Lens estimates the next run from the last 30 days.
Model cost is set per model in Settings > telemetry prices: by input and output tokens, by time (per hour), or off. A model with no price isn't costed, so local models stay free by default.
How:
app/domain/activity.pyholds the ledger, attribution scopes, request middleware and cost queries.app/domain/budgets.pyholds budgets, estimates, the pre-run check and the sweep./activity*,/budgets*,POST /jobs/{id}/releaseandPOST /routines/runs/{id}/decide.components/costskit.Tests: the new tests are tests/api/test_activity.py and test_budgets.py. The full backend suite was run on the embedded engine and on a real SurrealDB 3.2.4 server. The only failures were the known environmental conversion and voice tests. Frontend checks (tsc, eslint, jest 654) pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AMq5CNuWmtn3Suj1EamYBT