Files
jason.woltje 2627321f64 fix(model-proxy): row 333 R1 repair overlay as reviewed (source-tests.patch a78bc385, #1831)
Commits the 18 product paths of the row 333 R1 repair exactly as the reviewed overlay. Packet hashes: source-tests.patch sha256 a78bc385801b64be270fb9d6e84672c443738a5fce8eb68f7d2a01359a57a770 (40623 bytes), INDEX.json sha256 3eb9b8d10445aa328be3b854385e4792dda2c5712b19d443d485d1b00a18d0f8, changed-source-tests.json sha256 42f770fc3e2384362efd1e416091355c064b6cca22dd40f3b5ef8f7b67e43a52. The committed bytes were checked by applying source-tests.patch to 503b91e56 in a scratch tree and comparing the 18 paths. The approvals are source only: R2 (APPROVE source-only, 2026-10-26 23:32:39Z) and Boyd's first review (APPROVE, source only, 2026-10-27T00:27:55Z), both on HEAD 503b91e56 plus this overlay. No test has run on these bytes yet.
2026-11-02 13:36:45 -06:00
..

Token limit check

Row 125 (#1619), REQ-LIMIT-3 and REQ-LIMIT-4, limit-check interface 2. Enable with "plugins": { "limit-check": ["token-limit"] } in the organization file, keeping its other plug-in kinds. Human changes use mosaic plugins set and the current revision.

It enforces launch.limits.tokens: per role instance (instances), provider (providers), provider and model (models.<provider>.<model>) and key (keys). Each limit is {limit, since}.

  • A count is input + output + cacheWrite + cacheRead summed over the known per-turn records whose subject matches and whose at is at or after since. An unknown turn adds nothing; unknownTurns counts the distinct unknown turns apart, so a count is a floor, not proof.
  • With no usage source switched on, every turn's record is unknown (source @none), so every limit counts zero.
  • mayLaunch and mustStop answer the first limit, in the order above, that covers the subject and whose count is at or over it. A limit of 0 refuses every launch of its subject.
  • A key matches a record's account. Until accounts are named (row 126), every record's account is null, so a key limit matches nothing and report shows it as not enforced: no records name a key (lead decision 150, Q1).
  • Counts are summed as BigInt; one past Number.MAX_SAFE_INTEGER is reported as a digit string.

The module is pure: it reads no file and no store. A bad since or record at throws bad-time, a bad amount bad-record, and records that aren't a list bad-records; core turns any throw into a refusal, a stop, or check failed (fail closed).