Skip to content

W0.4 — Detailed context-usage panel showing MCP token cost #17

Description

@edelauna

Context

Roo shows total token usage at the top of the chat, but doesn't break down where those tokens go. Users trying to optimize MCP usage have no way to see "MCP tools cost N tokens this turn." Once dynamic loading lands, this panel is also how users will verify it's working ("attached 30 of 200 tools — saved 8k tokens").

Closes: RooCodeInc#10238.

Developer Notes

  • Compute per-section token costs at API request time: base prompt, system prompt sections, MCP tool array, conversation history.
  • Surface as an expandable panel in the chat header (or settings drawer) — collapsed by default.
  • Numbers come from the same tokenizer used to compute the total context.
  • Files: src/core/task/Task.ts (capture per-section sizes during request build), webview-ui/src/components/chat/ (new ContextUsagePanel.tsx), webview message channel for the breakdown.
  • Validation: panel reflects accurate counts for each section; total matches existing top-level token count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions