Repository navigation
Description
Problem
When the day's chat allowance runs out, the conversation turns into a dead end that names its own escape but never offers it. The proxy's refusals are already in reader language (web-packages/server/src/quota/guard.ts:92-104): "The daily chat limit for this network is used up. It resets at 00:00 UTC." and "Gamma Reader has used up the shared allowance for today. It resets at 00:00 UTC, and a model key of your own is not affected." The client recovers the sentence (ui-packages/web/src/core/models/proxy-error.ts) and shows it as the failed message's notice (ui-packages/web/src/features/conversation/use-conversation/messages.ts:68-76) — a plain paragraph with no action (ui-packages/web/src/features/conversation/conversation-messages.tsx:127-131).
The escape it names is real: a reader's own key is not affected. But the one button that opens the provider dialog appears only when no model exists at all (phase === 'unavailable', ui-packages/web/src/features/conversation/conversation-panel.tsx:214-224) — here models exist, so the phase stays ready and the button never shows. The only remaining entry is the last option of the model dropdown ("Add your own model…", ui-packages/web/src/features/conversation/model-control/index.tsx:66), which nothing points to. The composer sits open and inviting, so a reader's natural move is to re-send — and fail again with the same notice, until midnight.
Proposal
- When a failed reply's error is a quota refusal, render the notice with an action beside it: "Add your own model…", opening the same provider dialog the dropdown option and the unavailable-state button already open.
- Let the proxy mark the state structurally (a stable
codein the error body next tomessage), so the client recognizes a quota refusal without matching prose. - The per-network message ("The daily chat limit for this network is used up.") should also say an own key is unaffected, since the same repair applies.
Goal
After this, a reader who hits the day's limit sees the sentence and a one-tap path to the fix it names, instead of hunting a dropdown or re-sending into the same failure; no quota refusal ends in a notice that offers nothing to click.
Verification
pnpm --filter @gamma-reader/web test src/features/conversation
grep -n "quota" ui-packages/web/src/features/conversation/conversation-messages.tsx
pnpm checkRefs
- web-packages/server/src/quota/guard.ts:92-104 — the two quota refusals, prose that names (or omits) the own-key escape
- ui-packages/web/src/core/models/proxy-error.ts — the sentence already reaches the client intact
- ui-packages/web/src/features/conversation/use-conversation/messages.ts:68-76 and conversation-messages.tsx:127-131 — the failed-message notice, text only
- ui-packages/web/src/features/conversation/conversation-panel.tsx:214-224 — "Add a model to chat" bound to no-model-at-all
- ui-packages/web/src/features/conversation/model-control/index.tsx:66 — "Add your own model…", the entry nothing points at
- No-key chat is a dead end — the only 'Add your own model…' entry hides exactly when no model exists #159 — the dead-end-gains-a-button precedent this state repeats
- Say a failed own-key reply in reader language — the notice shows the vendor's raw JSON error body today #228 — the error-language member of this family (own-key vendor bodies); this is the free-allowance member, where the language is fine but the path is missing
- Remember the reader's model choice for new conversations — today every New chat silently returns to the free shared allowance, however often they pick their own key #184 — remembering the model choice, so the escape a reader sets up stays set
Activity
bencode commentedon Oct 26, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session, against
main@e8c930f.Evidence audit: all six citations confirmed verbatim.
guard.ts:92-104— both refusal sentences as quoted; ✅proxy-error.ts—readableProxyErrorrecovers the sentence from429: {"message":"…"}; ✅messages.ts:68-76— notice built onstopReason === 'error'; ✅conversation-messages.tsx:127-131— plain<p>, no action; ✅conversation-panel.tsx:214-224— "Add a model to chat" gated tophase === 'unavailable'(models exist here, so it never shows); ✅model-control/index.tsx:66— the unheralded dropdown entry.'gamma-reader-proxy'(model-runtime.ts:25), so own-key traffic bypassesguard.admitentirely — "not affected" holds for both the per-network and the shared limit, and bullet 3 (the per-network message naming the own-key repair) is sound.Duplicate check: none — #199 (endpoint token cap), #184 (remembering choice, completed), #174/#164 (key replacement / gone model) are adjacent, not overlapping.
Sensor: lint ✓; verify ✗ on main as it should be (
grep quota conversation-messages.tsxred — not vacuous).Refs: accurate and unusually strong — #159 and #184 are completed, so the "dead end gains its button" precedent is implemented behavior, not aspiration; #228 is the open sibling on a different surface (vendor error bodies vs missing path).
Verdict: valid, keep open. Two sharpenings:
proxy-error.tsreturnsmessagealone). Bullet 2's stablecodein the error body is the prerequisite for the button — exposecodethroughreadableProxyErrorand match on it, never on the sentence.grep -n "quota" conversation-messages.tsxpasses on an incidental comment. Anchor to the action — a test that a failure carrying the quota code renders the "Add your own model…" action (reusing the existingconfigureValueentry), or grep for the dialog-open call in the notice component.bencode commentedon Nov 1, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Against
main@d05b6b6(15 commits since the last review ate8c930f; two touch the cited conversation files:8c12225status line/announcements,29e1c71conversation notices).Evidence audit: premises hold; anchor drift.
guard.ts:92-104— the two refusals are now:94-99(per-network) and:102-107(shared); the cited range now cuts the second sentence's end. Prose unchanged, own-key escape still only in the shared message.proxy-error.tsunchanged — still recoversmessagealone, no structuralcode.messages.ts:68-76→:70-78— notice still built onstopReason === 'error'.conversation-messages.tsx:127-131— same lines; the notice<p>now carriesrole={message.failed ? 'alert' : 'status'}(from8c12225) — still text-only, no action.grep -i quotain this file: zero matches.conversation-panel.tsx:214-224→:222-230— a storage-warning block with its own dismiss button was added above (:207-219); "Add a model to chat" is still gated tophase === 'unavailable'.model-control/index.tsx:66— "Add your own model…" still the unheralded last option of the dropdown.Duplicate check: clean (open + closed); #262 (warn before the allowance runs out) is the before-the-limit sibling — different moment, not a duplicate. #159 remains the completed dead-end-gains-a-button precedent.
Sensor: lint ✓; verify ✗ as it should be (
grep quota conversation-messages.tsxred — not vacuous).Verdict: valid, keep open. The prior sharpening stands and is now easier to land: add the stable
codeto guard's refusal body, expose it throughreadableProxyError, match on it — never on the sentence. One new observation from the drift: the panel now has two fresh precedents for exactly this shape — notices differentiated byrolealert/status (conversation-messages.tsx:128), and a notice-plus-button sitting in the composer area (storage warning,conversation-panel.tsx:207-219). The quota action belongs on the failed/alert branch of the message notice, opening the samesetConfiguringModels(true)dialog the storage row's button pattern already rides beside.bencode commentedon Nov 8, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @
d05b6b6(still HEAD; zero commits since the 11-01 pass) — valid, stays open. #294/#295 (filed after that pass) don't overlap — #295 is which models a preset key serves, not the quota dead-end; #262 forecasts a low allowance, this is the action at the wall; #159/#228 remain the cited precedent/family.guard.ts(per-network at :98, shared-allowance at :107, matching the issue's quote verbatim);model-control/index.tsx:66is still exactly<option value={configureValue}>Add your own model…</option>; the failed-message notice is still a text-only<p>(conversation-messages.tsx:127-131, noquotaanywhere in the file); the escape button still gates onphase === 'unavailable'(conversation-panel.tsx:222);proxy-error.tsstill recovers onlymessage, no structural code.quotagrep — the 24 conversation tests pass first, so the failure is precisely the missing recognition.codestep is the load-bearing half — prose matching would break with the next wording tweak. Worth adding to the Verification a guard-side assertion that the 429 body carries the code and the client maps it (a test pair, server fixture → client notice + button), so an implementation that ships the button but matches prose fails loudly.No edits; stays open.