Skip to content

Preserve Claude model usage when canonical limits are unavailable - #8307

Merged
ymichael merged 1 commit into
mainfrom
slopcop/issue-8306
Nov 30, 2026
Merged

ymichael merged 1 commit into
mainfrom
slopcop/issue-8306

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

🚨 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.

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 b0ddaad731565d7e4de68d824120d802fc78f7d5.
  • 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 #8306

AGENT GENERATED

@ymichael
ymichael merged commit 789f214 into main Nov 30, 2026
36 checks passed
@ymichael
ymichael deleted the slopcop/issue-8306 branch November 30, 2026 21:10
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]>
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.

Provider usage: Claude Code per-model weekly limit (Fable) disappears when the CLI serves "seeded" usage data

2 participants