You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ai): the backend report skips the requests of build_agent #4716
The backend breakdown of the lifetime spend report (_QUERY_BACKEND_BREAKDOWN in src/devops_cli/ai/spend/ledger.py) keeps only rows with served_by IS NOT NULL. The spend hook of build_agent (src/devops_cli/ai/client/factory.py) passes server and served_model to track_request_spend, but not served_by. So the stage, refine and alternatives requests are not in the backend breakdown, and its mean_duration_seconds ignores them, even after #4504 records the duration of each request.
Reproduction Steps
Run an agent of build_agent on a model with a served_by URL.
Run get_lifetime_report() on the ledger.
report.backends has no entry for the request.
Expected vs Actual Behavior
Expected: the backend breakdown counts every request that a backend served, as the implement step does through record_run_spend.
Actual: the rows of the hook have served_by NULL.
Environment Diagnostics
origin/main after #4504. Found during #4504. Passing the value changes how the pricing registry reads local and hosted calls (calculate_request_cost(served_by=...)), so the fix needs a test of the price of a gateway request.
Pre-Submission Checklist
I searched open issues.
Alternatives check of 2026-11-14: none.
Tool: none found.
Reason: The need is internal: the project's own spend hook in src/devops_cli/ai/client/factory.py must pass served_by to track_request_spend so _QUERY_BACKEND_BREAKDOWN in src/devops_cli/ai/spend/ledger.py counts build_agent requests, plus a price test. Searches returned no external tool or library that provides this — the missing field is in the repository's own ledger code, which no third-party project can supply.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(ai)scope of the title gives the scope.Report data is incomplete but the tool does not crash.Backend breakdown accuracy improves for agent requests.Pass one field to an existing call and add one test.Both fix missing fields in the same build_agent spend hook; #4504 fixes duration_seconds, this fixes served_by.devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The need is internal: the project's own spend hook in
src/devops_cli/ai/client/factory.pymust passserved_bytotrack_request_spendso_QUERY_BACKEND_BREAKDOWNinsrc/devops_cli/ai/spend/ledger.pycounts build_agent requests, plus a price test. Searches returned no external tool or library that provides this — the missing field is in the repository's own ledger code, which no third-party project can supply.Tool: none found
Searches run:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
chore(main): release 0.138.0 (#5690)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC