Skip to content

Fix provider usage limit normalization - #1024

Merged
ymichael merged 6 commits into
mainfrom
bb/investigate-dashboard-rate-limits-thr_ud2yzsi98x
Aug 5, 2026
Merged

Fix provider usage limit normalization#1024
ymichael merged 6 commits into
mainfrom
bb/investigate-dashboard-rate-limits-thr_ud2yzsi98x

Conversation

@ymichael

@ymichael ymichael commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose Claude model-scoped weekly usage buckets such as Fable
  • isolate malformed optional Claude rows and suppress unsupported surface-scoped or duplicate labels
  • classify Codex weekly limits from the provider window duration instead of assuming the primary window is always a session limit
  • clarify provider hierarchy using the shared settings row, badge, and provider icon patterns
  • reuse Ladle's global router in the Automations breadcrumb story instead of nesting routers
  • bump the host-daemon protocol so enrolled hosts pick up the normalized provider usage behavior

Testing

  • pnpm exec turbo run test --filter=@bb/host-daemon --force (473 tests)
  • pnpm exec turbo run test --filter=@bb/host-daemon-contract --force (49 tests)
  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/settings/UsageLimitsSettingsSection.test.tsx
  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/tools/Automations.stories.test.tsx
  • pnpm exec turbo run typecheck --filter=@bb/host-daemon --filter=@bb/host-daemon-contract
  • pnpm exec turbo run typecheck --filter=@bb/app
  • pnpm exec turbo run build --filter=@bb/app

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

I am SlopCop. I will review this pull request against the configured security, quality, performance, architecture, and test rules.

The stack contains only PR #1024. I skipped no pull requests.

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

Security review complete. I found no security vulnerability.

The new provider label reaches React as text. React escapes the label. Percentage values stay between zero and 100. The change does not alter credential access or token output. The protocol version increase protects the changed daemon result meaning.

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

Code quality review complete. I found one high-risk robustness issue and two medium label risks.

One invalid Claude scoped limit makes the parser reject all valid Claude usage rows. The Codex fallback can give two different windows the same weekly label. Claude rows can also share a model label when their surfaces differ.

I will include verified findings in the final review.

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

Performance review complete. I found no new material hot-path cost.

The new Claude array has no size limit. A large provider response can increase the daemon payload and the settings row count. The existing provider fetch path also has no daemon cache, but this pull request does not add that behavior.

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

End-to-end review complete. I started the development app at commit 1d334f5dc.

The Usage limits page showed the Codex weekly limit. It also showed the Claude Fable scoped limit. Both values remained after a manual reload. The browser reported no warning or error during that reload.

Comment thread apps/host-daemon/src/provider-usage.ts Outdated
Comment thread apps/host-daemon/src/provider-usage.ts Outdated

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Review result: I found two correctness risks.

  • An invalid optional Claude scoped row makes the parser drop valid session and weekly rows.
  • Two Claude surfaces for one model can create duplicate labels and duplicate React keys.

I found no security vulnerability. I found no material performance regression. The new transform has linear cost.

The architecture scan found no duplicate provider normalizer. The host daemon remains the correct owner for provider translation. The protocol increase to version 71 matches the changed wire meaning.

Validation passed. The host daemon passed 471 tests. The contract package passed 49 tests. Both focused type checks passed. The development Usage limits page showed the Codex weekly row and the Claude Fable row after a manual reload.

The stack contains only PR #1024.

@ymichael
ymichael merged commit 67cd3c3 into main Aug 5, 2026
10 checks passed
@ymichael
ymichael deleted the bb/investigate-dashboard-rate-limits-thr_ud2yzsi98x branch August 5, 2026 19:08
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.

2 participants