You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hovering the usage indicator now reveals a per-part composition of the prompt,
modelled on Claude Code's `/context`: a stacked bar + legend showing how much
of the window the system prompt, tool definitions, conversation messages, and
free space each occupy.
The runtime persists an approximate decomposition of the stable request parts:
pi-adapter estimates `{ system, tools }` token cost (char/4 via approxTokens)
once per call and writes it to the step as `context_breakdown` alongside the
cache-inclusive `context_input_tokens`. The UI derives the "messages" bucket as
the real total minus those estimates, so the segments always sum to the gauge
even though the part figures are approximate. New shared helpers
`computeContextBreakdown` / `parseContextBreakdown` in token-accountant keep the
math testable and out of the component.
- entity-schema: additive `context_breakdown` string column on steps.
- outbound-bridge / pi-adapter: compute + persist the estimate.
- token-accountant: breakdown helpers + types, exported from the client entry.
- UI: HoverCard popover (ContextUsageDetails) with a composition bar + legend.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments