Skip to content

(MOT-4251) feat(console): add session usage metrics - #606

Draft
ytallo wants to merge 1 commit into
mainfrom
feat/console-session-metrics
Draft

(MOT-4251) feat(console): add session usage metrics#606
ytallo wants to merge 1 commit into
mainfrom
feat/console-session-metrics

Conversation

@ytallo

@ytallo ytallo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Surface provider-reported input, output, cache, reasoning, and cost metrics in a session metrics dialog.
  • Aggregate usage by turn and across the spawned session tree, while preserving the distinction between zero and fields a provider did not report.
  • Add persisted per-turn usage chips, Storybook coverage, unit tests, and Console E2E scenarios.

Why

The Console currently shows only an estimated context gauge, so developers cannot inspect the exact usage and cost reported by providers or understand how work is distributed across turns and sub-agents. These metrics make session consumption visible without presenting estimates as exact values.

Impact

Developers can open metrics from the Console header or context gauge, compare exact, counted, and estimated values, inspect per-turn model calls, review whole-tree and trace totals, and optionally hide transcript usage chips.

Validation

  • pnpm --dir console/web exec biome check <changed files>
  • pnpm --dir console/web typecheck
  • pnpm --dir console/web typecheck:e2e
  • pnpm --dir console/web exec vitest run src/lib/session-usage.test.ts src/lib/sessions/entry-mapper.test.ts — 70 tests passed
  • pnpm --dir console/web build
  • pnpm --dir console/web exec playwright test e2e/ui-metrics.spec.ts against the pinned integration stack — 2 tests passed

Fixes MOT-4251

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 27, 2026 3:16pm
workers-tech-spec Ready Ready Preview, Comment Jul 27, 2026 3:16pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 83722f63-95d9-4028-a54b-b7a7064564c8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/console-session-metrics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 49 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

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