Repository navigation
Description
Problem
A free reader discovers the day's allowance exists only when it is already gone. The proxy computes both sides of it on every request — per network store.tokensToday(subject, day) against dailyTokens (web-packages/server/src/quota/guard.ts:94), everyone together spentToday against totalDailyTokens (guard.ts:102) — yet the figure never leaves the server: an admission is { ok: true; done } | { ok: false; status; message } (guard.ts:15-16), silence or a refusal, with no remaining value in any response. The client matches that silence: across ui-packages/web/src the allowance appears only in code comments, static settings copy (model-providers/index.tsx:166), and the proxy's 429 text reaching core/models/proxy-error.ts — the conversation surface renders context and used tokens but never allowance state. So a reader several questions into a long document gets no signal that the next answer may refuse to start; the limit introduces itself by refusing, mid-session, when the only options are to stop reading or scramble for a key.
Proposal
- Carry the figure the guard already computes —
config.dailyTokens - store.tokensToday(subject, day)— out of the admission path with free-model responses (response header, usage envelope, or the stable error body Give the used-up daily allowance a path to the fix it names — today the refusal notice says a key of your own is unaffected, offers nothing to click, and the reader re-sends into the same failure #246 proposes; the channel is free to choose). - When remaining falls below a low threshold (e.g. <=20% of
dailyTokens), show one quiet line beside the composer for(free)models: "Free answers are running low today — a model key of your own is not affected." - Show it once per crossing, not per message; no dialog; no token numbers in the copy — the figure sets the threshold, the words stay reader language. The line should open the same provider dialog Give the used-up daily allowance a path to the fix it names — today the refusal notice says a key of your own is unaffected, offers nothing to click, and the reader re-sends into the same failure #246's refusal button opens.
Goal
After this, a free reader approaching the day's limit sees the notice while they can still act — add a key before being blocked, or spend the remaining answers deliberately — and the 429 refusal is no longer the first time the day's allowance is ever mentioned; no free reader learns of the limit from the refusal itself.
Verification
pnpm --filter @gamma-reader/server test src/quota
pnpm --filter @gamma-reader/web test src/features/conversation
grep -rn "running low" ui-packages/web/src --include='*.ts' --include='*.tsx' | grep -v '\.test\.'
pnpm check(The grep fails today — "running low" appears nowhere — and lists the new notice after implementation; the two test runs and pnpm check guard the surrounding contracts.)
Refs
- web-packages/server/src/quota/guard.ts:15-16 —
Admissionhas no channel for a remaining figure - web-packages/server/src/quota/guard.ts:88-113 — both limits already checked per request;
done(tokens)records after the fact - web-packages/server/src/quota/config.ts:13,18,30 —
dailyTokens200k per network,totalDailyTokens20M, env-overridable - ui-packages/web/src/core/models/proxy-error.ts — the only allowance words a reader ever sees arrive inside a 429 message
- ui-packages/web/src/features/conversation/model-control/index.tsx:55 — the
(free)label already distinguishes free models, so the client knows when the notice applies - ui-packages/web/PRODUCT.md:12-13 — own-key path "open, not hidden, but ... never a step on the way in": a quiet low-allowance line is that path surfacing at the honest moment, not an onboarding step
- Give the used-up daily allowance a path to the fix it names — today the refusal notice says a key of your own is unaffected, offers nothing to click, and the reader re-sends into the same failure #246 — same family at the moment of refusal (actionable button + stable code); this issue is the before-the-refusal member, and both should land on the same provider dialog
- Say a failed own-key reply in reader language — the notice shows the vendor's raw JSON error body today #228 — the error-language family member for own-key vendor bodies; adjacent, different ownership of the failing key
Activity
bencode commentedon Oct 27, 2026
Independent review — posted by the scheduled issue-reviewer loop (a session separate from the one that files these issues), under the maintainer's standing instruction to evaluate, sharpen, or retire
source:scheduledproposals. Audited againstmain@dbf9cb6.Evidence audit: every citation confirmed to the exact line.
guard.ts:15-17—Admissionis{ok:true; done} | {ok:false; status; message}; no channel for a remaining figure.guard.ts:94/:102—store.tokensToday(subject, day) >= config.dailyTokensandspentToday >= config.totalDailyTokensland on exactly the cited lines;:88-113covers both checks anddone(tokens).config.ts:13,18,30—defaultDailyTokens = 200_000,defaultTotalDailyTokens = 20_000_000,readQuotaConfigenv-overridable.model-control/index.tsx:55— the(free)optgroup label, exact;model-providers/index.tsx:166— the static note;PRODUCT.md:12-13— verbatim.remove-provider-dialog.tsx:20(the Let a reader replace a stored key in place — the only action on a configured provider today is Remove, which drops the model selection and switches conversations to the free allowance #174 dialog's "free allowance" sentence) — grep confirms no live allowance state anywhere inui-packages/web/src; the claim's substance holds.Sensor: lint ✓; verify ✗ on main ✓ ("running low" appears nowhere; both test suites in the block pass).
Verdict: valid, keep open. Two sharpenings:
guard.ts:102) while their network remaining looks healthy — the low-notice must cover both figures or explicitly scope to per-network and leave the shared case to Give the used-up daily allowance a path to the fix it names — today the refusal notice says a key of your own is unaffected, offers nothing to click, and the reader re-sends into the same failure #246's refusal. Worth deciding up front.bencode commentedon Oct 29, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @ d05b6b6 (stalest remaining review, first pass predated the 10-28 commits) — valid, one anchor corrected below; stays open.
guard.tsconfirms the whole premise:Admission(lines 15-17) has no channel for a remaining figure; the per-network checktokensToday(subject, day) >= dailyTokensand the sharedspentToday >= totalDailyTokenssit at the cited lines, both computed per request and discarded;config.ts:13/18/30holds 200k/20M defaults with env overrides;proxy-error.tsis indeed the only allowance words a reader sees;model-control/index.tsx:55carries the(free)label;PRODUCT.md:12-13quotes exactly.ui-packages/web/src/features/**settings**/model-providers/index.tsx:166("run on your own key and are not counted against the free allowance"), notfeatures/conversation/…— 258bab5 moved provider discovery to settings on 10-07, three weeks before filing. Content claim holds at the corrected path; no body edit needed (the Verification block does not cite that path)."running low"grep, which appears nowhere yet.bencode commentedon Nov 1, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit at d05b6b6 — valid, stays open (HEAD unchanged since the last review; this pass adds the gate-health check the 10-31 → 11-01 round gave the other issues).
Admissionstill has no channel for a remaining figure (guard.ts:13-17); both computed-then-discarded checks stand insideguard.ts:88-113(store.tokensToday(subject, day) >= config.dailyTokens,spentToday >= config.totalDailyTokens);config.ts:13/18/30still 200k/20M, env-overridable; the(free)label atmodel-control/index.tsx:55; the corrected settings anchor holds verbatim (settings/model-providers/index.tsx:166);PRODUCT.md:12-13verbatim; "running low" appears nowhere inui-packages/web/src— test files included."running low"grep at step 3. Correctly red.-tpattern (no vitest-5 vacuous exit-0) and no--silentbefore a positional (no Let a large workbook open without freezing the reader — today the whole sheet parses on the main thread before the first rows can show, and every row stays in memory though the grid draws a window #275-style crash); the grep's| grep -v '\.test\.'tail means a test-only phrase still fails the block — green requires production code. Sound as written. The standing sharpening is unchanged and remains the real gap: no command exercises "once per crossing, not per message" — the composer-side crossing-state test both prior reviews asked for is what would anchor the outcome rather than the phrase.bencode commentedon Nov 6, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit at d05b6b6 (HEAD unchanged since 2026-11-01) — valid, stays open.
Admissionstill has no channel for a remaining figure (web-packages/server/src/quota/guard.ts:14-17); both computed-then-discarded checks still stand atguard.ts:94(tokensToday(subject, day) >= config.dailyTokens) and:102(spentToday >= config.totalDailyTokens);config.ts:13,18,30still carries 200k / 20M, env-overridable; the(free)label is still exact atfeatures/conversation/model-control/index.tsx:55(the issue's own Refs cite this path correctly); the settings copy is verbatim atfeatures/settings/model-providers/index.tsx:166; "running low" still appears nowhere inui-packages/web/src."running low"grep. Gate health unchanged: no-tvacuity,grep -v '\.test\.'keeps test-only phrases red.Verdict unchanged; the standing sharpening remains the real gap: no command exercises "once per crossing, not per message" — the composer-side crossing-state test (fires on the crossing request, not again while still low, clears on recovery) is what would anchor the outcome.
bencode commentedon Nov 10, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit (fifth pass) @
d05b6b6— valid, stays open. HEAD unchanged since 2026-10-28; no commit, PR, or issue in any state has appeared since #295 (2026-11-05).Admissionstill has no remaining-value channel (guard.ts:15-16); both limits are still computed per request —store.tokensToday(subject, day) >= config.dailyTokensat:94,spentToday >= config.totalDailyTokensat:102— withdone(tokens)recording only after (:88-113); defaults still 200k / 20M env-overridable (config.ts:13,18,30). Client silence re-confirmed by fresh grep: allowance words occur only in code comments and static settings copy (model-providers/index.tsx:166,remove-provider-dialog.tsx:20), plus the 429 recovery inproxy-error.ts:2; the(free)label the notice would key on is atmodel-control/index.tsx:55.running lowgrep, which is empty on main. Discriminates correctly.bencode commentedon Nov 13, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit (sixth pass) @
d05b6b6— valid, stays open. HEAD unchanged since 2026-10-28; no commit, PR, or issue in any state has appeared since #295 (2026-11-05) — open PRs #287 and #293 touch neither surface.Admissionstill has no remaining-value channel (guard.ts:15-16); both limits are still computed per request and discarded on admission —tokensToday(subject, day) >= config.dailyTokensat:94,spentToday >= config.totalDailyTokensat:102; defaults still 200k / 20M env-overridable (config.ts); the(free)label the notice would key on is atmodel-control/index.tsx:55; fresh grep re-confirms "running low" appears nowhere inui-packages/web/src.running lowgrep. Discriminates correctly.