Skip to content

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

Open

Description

@bencode

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 code in the error body next to message), 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 check

Refs

Activity

  1. added
    enhancement
    source:scheduled
    on Oct 26, 2026
  2. bencode commented on Oct 26, 2026

    @bencode
    OwnerAuthor

    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 — readableProxyError recovers the sentence from 429: {"message":"…"}; ✅ messages.ts:68-76 — notice built on stopReason === 'error'; ✅ conversation-messages.tsx:127-131 — plain <p>, no action; ✅ conversation-panel.tsx:214-224 — "Add a model to chat" gated to phase === 'unavailable' (models exist here, so it never shows); ✅ model-control/index.tsx:66 — the unheralded dropdown entry.
    • ✅ Own-key escape verified structurally: user-configured providers never route through 'gamma-reader-proxy' (model-runtime.ts:25), so own-key traffic bypasses guard.admit entirely — "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.tsx red — 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:

    1. Sequence the structural code first: the client can recognize a quota refusal today only by matching prose (proxy-error.ts returns message alone). Bullet 2's stable code in the error body is the prerequisite for the button — expose code through readableProxyError and match on it, never on the sentence.
    2. Gate on the outcome, not the word: grep -n "quota" conversation-messages.tsx passes 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 existing configureValue entry), or grep for the dialog-open call in the notice component.
  3. bencode commented on Nov 1, 2026

    @bencode
    OwnerAuthor

    Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Against main@d05b6b6 (15 commits since the last review at e8c930f; two touch the cited conversation files: 8c12225 status line/announcements, 29e1c71 conversation 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.ts unchanged — still recovers message alone, no structural code.
    • 🔁 messages.ts:68-76 → :70-78 — notice still built on stopReason === 'error'.
    • ✅ conversation-messages.tsx:127-131 — same lines; the notice <p> now carries role={message.failed ? 'alert' : 'status'} (from 8c12225) — still text-only, no action. grep -i quota in 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 to phase === '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.tsx red — not vacuous).

    Verdict: valid, keep open. The prior sharpening stands and is now easier to land: add the stable code to guard's refusal body, expose it through readableProxyError, 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 by role alert/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 same setConfiguringModels(true) dialog the storage row's button pattern already rides beside.

  4. bencode commented on Nov 8, 2026

    @bencode
    OwnerAuthor

    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.

    • Evidence re-opened — anchors hold, two exact: both refusal sentences stand in guard.ts (per-network at :98, shared-allowance at :107, matching the issue's quote verbatim); model-control/index.tsx:66 is 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, no quota anywhere in the file); the escape button still gates on phase === 'unavailable' (conversation-panel.tsx:222); proxy-error.ts still recovers only message, no structural code.
    • Sensor re-run: lint ✓; verify ✗ at the quota grep — the 24 conversation tests pass first, so the failure is precisely the missing recognition.
    • One sharpening: the proposal's stable-code step 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsource:scheduled

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions