Summary
With Claude Code's autoCompactWindow set to 256000, bb's context ring shows
256K after a turn, then 1M while the next turn runs, and returns to 256K after
that turn. The two denominators describe different things: the configured
auto-compact window and the model's context capacity. This makes the same ring
change scale during normal agent activity.
Reproduction
- Use bb 0.44.0 with the Claude Code provider and a Claude model whose
modelUsage.contextWindow is 1M.
- Set Claude Code's
autoCompactWindow to 256000.
- Complete a turn and observe the context ring at 256K.
- Start another turn and observe the ring while the agent is working. It
changes to 1M, then returns to 256K after the post-turn context snapshot.
The event trace below came from bb thread log <thread-id> --all --json in
bb 0.44.0. The raw thread log is omitted because it contains conversation
content.
| Sequence |
Event |
modelContextWindow |
snapshot.contextWindowTokens |
| 16750 |
turn/completed |
— |
— |
| 16751 |
thread/contextWindowUsage/updated |
256000 |
256000 |
| 16752 |
turn/started |
— |
— |
| 16756 |
thread/contextWindowUsage/updated |
1000000 |
absent |
| 16758 |
thread/contextWindowUsage/updated |
1000000 |
absent |
The same pattern repeats at seq 16861 (256000 with snapshot), 16867 and
16869 (1000000 without snapshot), and 16872 (256000 with snapshot).
Expected behavior
The native ring should keep the latest Claude auto-compact snapshot's
contextWindowTokens (256K here) as its denominator throughout subsequent
turns, while still updating the used-token estimate. A streamed model-capacity
value should not replace that display denominator while the auto-compact
window is active. The underlying 1M model capacity should remain available.
Code pointers
In the installed bb 0.44.0 bundle under node_modules/bb-app/:
server/dist/builtin-plugins/provider-claude-code/dist/host.js:208 calls
session.getContextUsage() after a turn and publishes
snapshot.contextWindowTokens as the context-window size.
- The same
host.js:196 extracts modelUsage.contextWindow from Claude SDK
messages for the streamed context event.
server/dist/start-server.js:62035-62087 selects the latest usable context
event, so the next streamed 1M event replaces the 256K snapshot in the
indicator's input.
Related source at the bb 0.44.0 source baseline (0baa605b):
snapshot publication,
context normalization,
SDK extraction,
latest-event projection,
and ring rendering.
Could the indicator retain the most recent auto-compact snapshot window
through later estimated stream events? A regression case with the alternating
event order above would make the behavior testable.
Summary
With Claude Code's
autoCompactWindowset to256000, bb's context ring shows256K after a turn, then 1M while the next turn runs, and returns to 256K after
that turn. The two denominators describe different things: the configured
auto-compact window and the model's context capacity. This makes the same ring
change scale during normal agent activity.
Reproduction
modelUsage.contextWindowis 1M.autoCompactWindowto256000.changes to 1M, then returns to 256K after the post-turn context snapshot.
The event trace below came from
bb thread log <thread-id> --all --jsoninbb 0.44.0. The raw thread log is omitted because it contains conversation
content.
modelContextWindowsnapshot.contextWindowTokensturn/completedthread/contextWindowUsage/updatedturn/startedthread/contextWindowUsage/updatedthread/contextWindowUsage/updatedThe same pattern repeats at seq 16861 (256000 with snapshot), 16867 and
16869 (1000000 without snapshot), and 16872 (256000 with snapshot).
Expected behavior
The native ring should keep the latest Claude auto-compact snapshot's
contextWindowTokens(256K here) as its denominator throughout subsequentturns, while still updating the used-token estimate. A streamed model-capacity
value should not replace that display denominator while the auto-compact
window is active. The underlying 1M model capacity should remain available.
Code pointers
In the installed bb 0.44.0 bundle under
node_modules/bb-app/:server/dist/builtin-plugins/provider-claude-code/dist/host.js:208callssession.getContextUsage()after a turn and publishessnapshot.contextWindowTokensas the context-window size.host.js:196extractsmodelUsage.contextWindowfrom Claude SDKmessages for the streamed context event.
server/dist/start-server.js:62035-62087selects the latest usable contextevent, so the next streamed 1M event replaces the 256K snapshot in the
indicator's input.
Related source at the bb 0.44.0 source baseline (
0baa605b):snapshot publication,
context normalization,
SDK extraction,
latest-event projection,
and ring rendering.
Could the indicator retain the most recent auto-compact snapshot window
through later estimated stream events? A regression case with the alternating
event order above would make the behavior testable.