Skip to content

Timeline: token spend per Bot, from the activity feed #536

Closed

Description

@HugoXK

What

#357 (performance/quality board) and #401 (cost per item) want cost visible. The timeline shows models and durations but not how many tokens each Bot spent, so where the team's model quota goes is invisible.

Expected behavior

  • The activity feed's turn.end gains tokens (the counts a turn's model calls reported: input/cacheRead/cacheWrite/output), summed from the turn's assistant/message usage, each floored and capped. Counts only, never text.
  • The timeline records them (short keys) and timeline/window carries usage per Bot: { lane, calls, input, output, cacheRead, cacheWrite }.
  • Read-only; absent when the adapter reported no usage.

Change scope

core/src/host/flybot-feed.js (fold usage, cap), core/types/flybot.d.ts, plugins/timeline/src/{recorder,sanitize,window}.js, tests (core/test/flybot-feed.test.js, plugins/timeline/test/{recorder,window}.test.js), docs. No new dependency; no egress; metadata only.

Why

Cost/token visibility next to the run (the quality-visible bet, #361).

Activity

  1. Birfy commented on Oct 20, 2026

    @Birfy
    Collaborator

    Triage (Birfy, 2026-10-20 20:08 Asia/Shanghai). Token spend per Bot in the timeline: the activity feed's turn.end gains tokens, which the timeline records and sums into usage per Bot. It touches core (flybot-feed.js) and the timeline plugin. HugoXK's PR #537 implements it; reviewed FAIL at b157f8f.

    Design check: it conflicts with simplicity/consistency. FlyBot already has a per-Bot token ledger (core/src/host/usage.js, the Usage page) that counts billed attempts the way DSH does (retries, stream usage, forks, group Sessions). This adds a second counter that sums only assistant/message usage, so the two will disagree for the same Bot. Same series as #530/#534/#538, with no overlap with the merged export (#484/#523/#524).

    Proposed scope if accepted: no new feed field. The timeline (or the panel) reads per-Bot totals for the window from the existing usage ledger. Otherwise, close it as covered by the Usage page.

    needs-human: the owner needs to confirm whether this is wanted at all (given the Usage page) and whether HugoXK's #537 is accepted after it is reworked onto the ledger.

  2. added
    enhancement
    area:automation
    needs-human
    on Oct 20, 2026
  3. Birfy commented on Oct 20, 2026

    @Birfy
    Collaborator

    Owner decision (2026-10-20 21:09 Asia/Shanghai): accepted (option a) with a change: token numbers must come from the existing Usage ledger, not a separate count, so they match the Usage page. PR #537 needs that change.

  4. added
    agent-ready
    agent-working
    and removed
    needs-human
    on Oct 20, 2026
  5. Birfy commented on Oct 21, 2026

    @Birfy
    Collaborator

    Implemented by PR #537 (merged as 105ec65b, 2026-10-21 00:27Z), which records per-Bot token counts on the activity feed's turn.end and exposes usage per Bot in timeline/window.

    The PR body only referenced #357/#401, so GitHub did not auto-close this issue. Closing it by hand with that evidence; the agent-working and agent-ready labels come off.

  6. removed
    agent-working
    agent-ready
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions