Skip to content

Context breakdown panel: redesign the Developer Mode layout and bound the usage fold state #24030

Closed

Description

@chenmingwei23

What

Follow-up to #23648 (which records the KAS per-turn context breakdown in the crew log, for #21277). Redesign the Context breakdown panel in Developer Mode and make the backend state behind it fixed-size.

Panel:

  • Kiro Crew's own blocks (rules, memory, skills, other) are the first top-level row.
  • Below it, the KAS categories sorted by size: Built-in tool definitions, MCP tools, Kiro instructions, Steering and agent resources (lists with counts), Workspace, Tool calls and results (with Calls and Results), Messages (the KAS history minus the Kiro Crew blocks), Other. Rows with zero size are hidden.
  • A colored stacked bar shows each row's share of totalChars. A thin window bar below it shows the share of the model window, for example "4% of the 1M-token window".
  • For turns that are not KAS (Kiro CLI and others), the rows are in tokens, with Kiro Crew's blocks estimated as chars/4. A "Rest of the context" remainder row has an info tooltip that tells the user to pick Kiro Agent in Settings > Agent Harness to see the full breakdown.

Backend:

  • The usage fold state becomes fixed-size: a ring of the newest 30 turns x 6 integers, a counter, and a session-start row. The KAS breakdown is last-wins. No per-turn block-name history is kept.
  • Measured on a 1,000-turn session: state 111 KB -> 2.8 KB, push 196 KB -> 5.7 KB, on-loop json.dumps 798 us -> 32 us.
  • Opt in to contextBreakdown on session/new and session/load.
  • Keep the summary fields that parse_breakdown drops today.

i18n: every string added or changed is translated in all shipped locales.

Why

A user debugging a large context needs one view that shows where the window goes: Kiro Crew's own blocks and the engine's categories together, sorted by size, with the window share visible. The fold state behind the panel also grows with every turn (111 KB at 1,000 turns), and that state is pushed to the dashboard. A fixed-size state removes that growth.

Additional Context

Activity

  1. added
    enhancementNew feature or request
    area: dashboardDashboard UI and its backend handlers
    tier:T3Changes an existing user experience; needs a one-pager
    tier:T2Small additive feature; existing behaviour unchanged
    triagedA person has read this issue and accepted its tier
    and removed
    tier:T3Changes an existing user experience; needs a one-pager
    on Oct 25, 2026
  2. added
    tier:T3Changes an existing user experience; needs a one-pager
    and removed
    tier:T2Small additive feature; existing behaviour unchanged
    on Oct 25, 2026
  3. 20 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: dashboardDashboard UI and its backend handlersenhancementNew feature or requesttier:T3Changes an existing user experience; needs a one-pagertriagedA person has read this issue and accepted its tier

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions