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
Keep the context/usage slot's turn totals (they are useful).
Also show current context occupancy: how large the last (or active) model request was — the thing that can hit the window.
Today the slot paints AI SDK result.usage (phase 3 #539 / PR #547, product #327). On a tool loop that value is the sum of every step. A turn that prints 1.3M in · 13.3k out · 1.3M tok · 1.2M cached can be 15 × ~90k-input steps, all inside a 200k/1M window. Totals look like overflow. Occupancy would not.
Keep (do not remove)
Figure
Meaning
Turn in / out / tok / cached
Provider sum across steps — cost / “this turn was huge”
Honesty locks
source: 'provider' only, no client tokenizer, no fake % without a catalog max
Abort/cancel
keep last honest paint; completed turn with nothing usable hides
Host-local
not a cloud meta key
Add
Want
Not
Input tokens on the last step (or max step, if last is a tiny wrap-up call)
Replacing the sum
Optional cache-read on that same step
Using the summed cache as occupancy
Optional later: catalog window → honest % only with a real max
Guessed denominator
Suggested paint (host-folded string, Wasm still generic slot 3), e.g.
90k ctx · 1.3M in · 13.3k out
or a second slot if 96 bytes cannot hold both honestly (truncateStatusValue already ellipsizes).
Success: a 15-step turn on a 200k model still shows the 1.3M in total and ~80–180k ctx.
Constraints
Still provider-sourced. Prefer result.steps[i].usage (or equivalent). If the SDK only exposes the aggregate, omit occupancy — do not invent a client token count and do not relabel the sum as ctx.
Completed turn with totals but no per-step usage → keep painting totals; occupancy hidden.
Cap: USAGE_SUMMARY_MAX_BYTES / STATUS_SLOT_MAX_BYTES (96). Extending the carrier is a NEW field + Caps table in the phase plan (do not silently jam two meters into a 96-byte JSON that then drops).
Summary
Keep the context/usage slot's turn totals (they are useful).
Also show current context occupancy: how large the last (or active) model request was — the thing that can hit the window.
Today the slot paints AI SDK
result.usage(phase 3 #539 / PR #547, product #327). On a tool loop that value is the sum of every step. A turn that prints1.3M in · 13.3k out · 1.3M tok · 1.2M cachedcan be 15 × ~90k-input steps, all inside a 200k/1M window. Totals look like overflow. Occupancy would not.Keep (do not remove)
source: 'provider'only, no client tokenizer, no fake%without a catalog maxmetakeyAdd
%only with a real maxSuggested paint (host-folded string, Wasm still generic slot 3), e.g.
90k ctx · 1.3M in · 13.3k outor a second slot if 96 bytes cannot hold both honestly (
truncateStatusValuealready ellipsizes).Success: a 15-step turn on a 200k model still shows the 1.3M in total and ~80–180k ctx.
Constraints
result.steps[i].usage(or equivalent). If the SDK only exposes the aggregate, omit occupancy — do not invent a client token count and do not relabel the sum as ctx.USAGE_SUMMARY_MAX_BYTES/STATUS_SLOT_MAX_BYTES(96). Extending the carrier is a NEW field + Caps table in the phase plan (do not silently jam two meters into a 96-byte JSON that then drops).agent-sessionor project 3.Non-goals
Related