Skip to content

Publish Claude request occupancy from assistant messages - #3221

Open
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3220
Open

Publish Claude request occupancy from assistant messages#3221
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3220

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

Claude assistant translation extracted each valid request-context sample but only stored it in thread state. The context-window delta was constructed later in result translation, so intermediate assistant updates could not publish current context occupancy. The verified reproduction and root-cause report is https://get-bb.github.io/reports/issues/3220.html.

What changed

Top-level Claude assistant messages now emit an estimated context-window delta immediately, using the current model-capacity hint while preserving unknown capacity as null. Nested assistant usage is excluded from the parent context state. The scripted bridge calibration expectation now includes the new intermediate events. There are no wire, protocol, schema, dependency, generated-file, migration, storage, authentication, authorization, permission, packaging, or release changes.

Changed-line count: 145 total text lines (142 additions and 3 deletions) across 3 files.

How you verified

  • Before the production change, the focused assistant-message regression test failed because only turn/started was emitted and the expected context-window event was absent. The failure repeated in a second clean checkout at the trusted base commit.
  • After the change, the focused usage suite passed all 16 tests, including nested-agent isolation.
  • pnpm exec turbo run test typecheck --filter=bb-plugin-provider-claude-code passed: 25 test files, 362 tests, and provider typecheck.
  • git diff --check origin/main..HEAD passed.
  • The EAP model-codename scanner passed for the working tree and origin/main..HEAD.

Fixes #3220

AGENT GENERATED

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code context usage is only emitted at final result, leaving the meter stale during tool loops

1 participant