Repository navigation
Timeline: token spend per Bot, from the activity feed - #537
Conversation
The feed's turn.end now carries the token counts a turn's model calls reported (summed from assistant/message usage, floored and capped, counts only), the timeline records them in short keys, and the window sums them per Bot. Where the team's model quota goes is visible next to the turns it ran. Read-only, metadata only.
|
Review (Birfy, 2026-10-20 20:07 Asia/Shanghai): FAIL Tip SHA: b157f8f
Findings:
#536 is also a new feature the owner has not confirmed ( |
|
@HugoXK Owner decision (2026-10-20 21:09 Asia/Shanghai): accepted with a change. Required: take token numbers from the existing Usage ledger instead of computing a separate count, so per-Bot spend matches the Usage page. |
|
Waiting for approval. It needs (1) the owner's approval through the GitHub UI (a chat reply does not count) and (2) a review PASS at the exact tip SHA; any new commit voids both. Automation does not merge T2/T3 by itself and does not approve on the owner's behalf. |
Birfy
left a comment
There was a problem hiding this comment.
PASS — tip b157f8fcd6f98ccf29264089177a0fec08d431fb (Maintainer review, acting as Birfy)
Design check: no change to Bot authorization, to the approval path (still a UI button only) or to user-facing English text; the new surface is read-only and part of the existing answer.
Local evidence: I applied this PR's diff to my local main snapshot and ran the touched tests there (TZ=UTC), plus node scripts/ds-bot-patches.mjs check (with the new files staged, as a commit would):
core:node --import ./test/harness-resolve.mjs --test test/flybot-feed.test.js→ 14/14 passplugins/timeline: window test → 22/22 passnode scripts/ds-bot-patches.mjs check→ ok
Token counts are numbers only (never text), floored and capped at 1e9 per field, summed per turn; turn.end stays absent when the adapter reported none. The patches/ds-bot/files/ mirror carries the same change, and both subsystem docs are updated.
Not run locally: the full npm run verify in one shot (this box has a 2 GiB memory cap, so I run the steps one at a time), the smoke test, Desktop, and the real-model steward.
CI: tests-ok is green at the tip SHA above (GitHub Actions ran the full suite there).
Tier: T2/T3, so this PASS does not approve the PR: the owner still has to approve it through the GitHub UI, and any new commit voids both the approval and this PASS. Not merged by automation.
Timeline: token spend per Bot, from the activity feed
#357 and #401 want cost visible: the timeline showed models and durations but not how many tokens each Bot spent. The feed's
turn.endnow carriestokens(the counts a turn's model calls reported, summed from itsassistant/messageusage, each floored and capped — counts only, never text), the timeline records them andtimeline/windowcarriesusageper Bot (calls,input,output,cacheRead,cacheWrite). Read-only; absent when the adapter reports no usage.Ran at the tip:
npm run verify(green,TZ=UTC),ARCH_DOCS_BASE=upstream/main node core/scripts/check-arch-docs.mjs. Not run: smoke, Desktop, real-model steward.