Skip to content

feat(overview): show tokens used and session time instead of token cost - #589

Merged
artempartos merged 1 commit into
developfrom
artempartos/project-overview-hide-token
Oct 27, 2026
Merged

artempartos merged 1 commit into
developfrom
artempartos/project-overview-hide-token

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Summary

The project Overview showed a "Token Cost" card: what the tokens agents consumed would cost at API prices. Sales kept having to explain that this is not what a customer pays, and that for agents running on a subscription it is not a real cost at all. The card is replaced by two that describe the work without implying a bill:

  • Tokens Used: total tokens across the project's sessions (the same total_tokens the sessions list shows), with a per-session average.
  • Session Time: start-to-finish time summed across sessions, with a per-session average. A live session counts up to now, the same way its row does in the sessions list.

The KPI row now holds five cards: one row on a full-width screen, 3 + 2 below 1100px, 2 columns below 720px.

TerminalSession::DURATION_SECONDS_SQL is pulled out of the duration_seconds ransacker so that the sessions-list sort and the Overview sum share one definition of duration. totalSpendCents is gone from the Overview props, since nothing else read it. Analytics still shows cost; this PR does not change it.

During a rolling deploy, a new bundle polling an old pod gets no totalTokens or sessionSeconds. Both formatters render that as — until the next poll; nothing throws.

CHANGELOG entry is under Changed / Overview, and the product docs no longer mention token cost on this page.

Test plan

  • test/services/company_overview_service_test.rb (new): tokens and duration summed per project, other projects excluded, never-started sessions add no time, running session counts to now, zero for an empty project
  • overview_controller_test.rb: Inertia props carry totalTokens and sessionSeconds, and no totalSpendCents
  • OverviewPage.test.tsx: new labels, compact token and hour/minute formatting, per-session averages, no $ on the page
  • Ran locally: the files above plus overview_render_test, overview_authorization_test, changelog_test (20 runs, 0 failures), vitest (12/12), rubocop, eslint, tsc
  • Browser check on a worktree stack with 40 seeded sessions, at 1440, 1469 and 1024px: no horizontal overflow
  • Full suite: CI is the verification

🤖 Generated with Claude Code

A dollar figure for tokens read as what the customer actually pays, which
it is not when their agents run on a subscription. Tokens and time in
sessions describe the work without implying a bill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit da420e9 into develop Oct 27, 2026
16 checks passed
artempartos added a commit to Hitin/flow that referenced this pull request Oct 28, 2026
* origin/develop:
  docs(workflows): describe workflows as sessions made of steps (AixleHQ#595)
  feat(workflows): open archived workflows read-only in the builder (AixleHQ#594)
  feat(task-comments): let authors delete their own recent comments (AixleHQ#593)
  feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592)
  fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591)
  feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590)
  feat(overview): show tokens used and session time instead of token cost (AixleHQ#589)
  fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587)
  test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586)
  test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584)
  feat(runners): add the runners table and the Runner model (AixleHQ#583)
  refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579)

# Conflicts:
#	CHANGELOG.md
artempartos added a commit to Hitin/flow that referenced this pull request Oct 28, 2026
* origin/develop:
  docs(workflows): describe workflows as sessions made of steps (AixleHQ#595)
  feat(workflows): open archived workflows read-only in the builder (AixleHQ#594)
  feat(task-comments): let authors delete their own recent comments (AixleHQ#593)
  feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592)
  fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591)
  feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590)
  feat(overview): show tokens used and session time instead of token cost (AixleHQ#589)
  fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587)
  test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586)
  test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584)
  feat(runners): add the runners table and the Runner model (AixleHQ#583)
  refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant