Repository navigation
Preserve Claude model usage when canonical limits are unavailable - #8307
Merged
Merged
Conversation
3 tasks done
scowalt
pushed a commit
to scowalt/bb
that referenced
this pull request
Dec 1, 2026
…t-bb#8307) 🚨 **SLOP COP** 🚨 · `new-issue-autopilot` ## Human comments ## What was wrong Claude usage normalization reads model windows exclusively from canonical `limits`. When those rows are unavailable, valid SDK `model_scoped` entries are silently discarded even though aggregate usage succeeds. The boundary regression reproduces on trusted main in two clean checkouts. [Reproduction and root-cause report](https://get-bb.github.io/reports/issues/8306.html). ## What changed - Validate alternate model-scoped usage at the provider boundary and reuse existing normalization only when canonical limits yield no model windows. - Preserve canonical precedence, model deduplication, percentage clamping, reset normalization, and malformed-row tolerance. - Extend the existing owner test and add a three-case regression for absent, empty, and aggregate-only limits. No dependencies, generated files, stored data, public contracts, daemon wire fields, or CLI/configuration changes. - Changed-line count: **82 total text lines** across **2 files** (81 additions, 1 deletion). ## How you verified - Before the fix, `pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/bridge/provider-maintenance.test.ts` fails in the three new cases, with the two original cases passing. The same result repeats in a second clean checkout at `a8c32288cf24894fbe85cb3a9ca0469c7a997ed6`. - After the fix, the focused file passes all 5 tests. Relevant usage tests pass all 12 cases with `pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/bridge/provider-maintenance.test.ts src/bridge/provider-maintenance.account.test.ts src/usage-source.test.ts`. - Provider typecheck and lint pass; the repository Turbo build passes all 74 tasks after SDK bootstrap. Formatting and `git diff --check` pass; no binary changes. - Full provider suite: 462 pass, 6 fail. All six unrelated installation-discovery/sandbox/permission failures also reproduce on unchanged main in the second checkout; no unrelated production code is changed. - Synthetic normalization reproduction, not a live authenticated CLI throttling capture. Fixes get-bb#8306 > AGENT GENERATED <!-- slopcop:rule=new-issue-autopilot run=run_mj9wiz5emx0kapgb sha=issue-8306 kind=summary --> Co-authored-by: SawyerHood <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨 SLOP COP 🚨 ·
new-issue-autopilotHuman comments
What was wrong
Claude usage normalization reads model windows exclusively from canonical
limits. When those rows are unavailable, valid SDKmodel_scopedentries are silently discarded even though aggregate usage succeeds. The boundary regression reproduces on trusted main in two clean checkouts. Reproduction and root-cause report.What changed
How you verified
pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/bridge/provider-maintenance.test.tsfails in the three new cases, with the two original cases passing. The same result repeats in a second clean checkout atb0ddaad731565d7e4de68d824120d802fc78f7d5.pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/bridge/provider-maintenance.test.ts src/bridge/provider-maintenance.account.test.ts src/usage-source.test.ts.git diff --checkpass; no binary changes.Fixes #8306