Files
ai-kit/test
CatoandClaude Opus 5.5 102ab386e7 fix(byok): a reader's own key never touches the deployment's bookkeeping (1.18.0) (#77)
byokChain links share their provider id with the deployment's link to the same
vendor (groq is groq), and every shared ledger in this package keys on it. So:

- Provider.byok marks an own-key link (set by byokChain).
- dayCapacityTokens never counts it, even with a *_DAILY_TOKENS override.
- createLinkCooldown never cools a link because of it — one reader's
  exhausted personal quota used to cool groq/<model> for everybody.
- tryChain / walkChain / completeStream record no health for it: one reader's
  bad key says nothing about whether the site's AI works.
- Quota readings about it carry byok: true, so an app's store can skip them.
- dailyTokens is 0, not Infinity: a caller summing it by hand adds nothing.
- New exports: isOwnKeyLink(link), healthFor(chain, health).

No live app was exposed (checked loki, substrata, heidi, orangecat, evig,
petvity: none fed an own-key chain into capacity); this closes the trap for
the next one. Each guard mutation-checked.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 03:31:03 -07:00
..