Repository navigation
fix(roadmap): count the tokens of each implement Job once - #4213
Conversation
Plan the change 4200 and add the failing tests: the counter must add only the tokens of the reported Job, because implement.spend is the sum of all Jobs.
Record implement.spend_counted with the Job state, add only the tokens above it to the counter, and clear it with the spend at a retry and a return to New.
|
Test record for #4200. Fail-to-pass ( Full CI ( Narrow checks after the rebase onto Old records: a test loads a record that has Not changed: no setting, ConfigMap key or Settings field. So no ConfigMap load test. |
🤖 I have created a release *beep* *boop* --- ## [0.100.0](v0.99.0...v0.100.0) (2026-11-09) ### Features * **roadmap:** record the reference hits of a stage case in the replay ([#4211](#4211)) ([06a7251](06a7251)) ### Bug Fixes * **roadmap:** accept a null reason on a stage reference ([#4215](#4215)) ([ce96397](ce96397)) * **roadmap:** count the tokens of each implement Job once ([#4213](#4213)) ([a243c25](a243c25)) * **roadmap:** send tool choice auto to Claude and count answers ([#4216](#4216)) ([5c4cabf](5c4cabf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The Service adds the tokens of a reported runner Job to
devops_cli_service_implement_tokens_total. Since #4070 the recordimplement.spendholds the sum of all Jobs of an item, but each report added the whole sum. So the tokens of an earlier Job counted again at each later report.The record now keeps
implement.spend_counted, the total that the counter already holds. A report writes it with the Job state and adds only the difference to the counter. A retry and a return to New clear it with the spend. An old record without the key counts its whole spend once.Closes #4200
Change:
openspec/changes/archive/2026-11-09-4200-count-the-tokens-of-each-implement/