Skip to content

Say when a conversation's own-key model is gone — it silently switches to the free shared allowance today #164

Closed

Description

@bencode

Problem

A conversation remembers the model it runs on (selection on StoredConversation), and a reader's own key is a deliberate choice: the product promises "With a key of your own, the browser talks to the provider directly. Nothing about that conversation reaches Gamma Reader's server" (tutorial/guide/Your data and models.md:19), and the picker marks those models "(your key)" against "(free)" (features/conversation/model-control/index.tsx:50-57). But when that model is no longer configured — the reader removed the provider (features/settings/model-providers/index.tsx:173-177), or the provider no longer offers it — the next attach of the conversation resolves the selection to the shared-allowance default with no signal (core/models/model-selection.ts:15-23: requested not found → runtime.defaultModel), and attachAgent replaces the conversation's selection with the fallback in state, saved with its next draft (features/conversation/use-conversation/agent-session.ts:105,127). The next message then runs through Gamma Reader's proxy — the path the reader opted out of — and consumes the shared allowance, with nothing in the conversation saying so. The picker shows the free model only if the reader happens to look. Total absence of models is an explicit state (phase: 'unavailable'); a disappearing own-key model is a silent switch.

Proposal

  • When resolveModelSelection falls back because the requested provider/model is unavailable, surface it in the conversation panel's existing quiet status surface (features/conversation/conversation-panel.tsx:127-131): e.g. "{model} (your key) is no longer configured; this conversation now runs on {default} (free)."
  • Show the notice on attach and keep it until the reader picks a model, so it is read before the next message is sent, not after.
  • The resolved-selection behavior itself stays (a stale selection should not block chat); the notice is the contract.

Goal

After this, a reader whose own-key model disappears from the configuration sees, before sending anything, that the conversation now runs on the free shared model — no conversation changes allowance or routing without the reader being able to see it first.

Verification

grep -rq "no longer configured" ui-packages/web/src/features/conversation
pnpm --filter @gamma-reader/web test --silent
pnpm check

Refs

  • ui-packages/web/src/core/models/model-selection.ts:15-23 — silent fallback to runtime.defaultModel
  • ui-packages/web/src/features/conversation/use-conversation/agent-session.ts:105,127 — resolution replaces the conversation's stored selection
  • ui-packages/web/src/features/settings/model-providers/index.tsx:173-177 — Remove leaves stored selections stale
  • ui-packages/web/src/features/conversation/conversation-panel.tsx:127-131 — existing status notice surface
  • ui-packages/web/src/shell/byok.test.tsx — integration-test pattern ("sends to the vendor with that key and never through our proxy")
  • tutorial/guide/Your data and models.md:19 — the BYOK promise the silent fallback breaks
  • No-key chat is a dead end — the only 'Add your own model…' entry hides exactly when no model exists #159 — adjacent BYOK configuration gap (the entry hides when no model exists); this issue is the silent switch when a configured one disappears

Activity

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

    @bencode
    OwnerAuthor

    Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session.

    Evidence audit (main @ ebb0ee0): all citations hold.

    • Silent fallback confirmed at core/models/model-selection.ts:15–23 — requested model not found ⇒ ?? default-model match; total absence is indeed the explicit phase: 'unavailable' state (agent-session.ts:100).
    • Resolution replaces the stored selection (agent-session.ts:105 resolves, :127 setActive with selectionFromState(state)).
    • Remove button leaves selections stale (model-providers/index.tsx:173–177); the "(your key)"/"(free)" optgroup labels (model-control/index.tsx:50–57) and the guide's promise verbatim (tutorial/guide/Your data and models.md:19); conversation-panel.tsx:127–131 is a real quiet-status surface (role="status"); byok.test.tsx:32 title matches verbatim.

    Sensor: lint passed; verify failed as it should — the no longer configured grep finds nothing on main. Honest gate.

    Sharpening suggestions:

    1. Trigger condition: only fire the notice when a requested selection existed and wasn't found — a conversation with no stored selection legitimately lands on the default (model-selection.ts handles requested === undefined), and the notice must not appear for fresh conversations. Capture the pre-resolution conversation.selection at attach; by agent-session.ts:127 the stored selection is already the fallback, so the trigger cannot be read back from state later.
    2. resolveModelSelection returns only { model, thinkingLevel } — the fallback fact has to come out of the ?? branch there (or a comparison at the call site), not be re-derived downstream.
    3. Wording should name the routing consequence ("runs through Gamma Reader's proxy on the shared allowance") — that is the promise the fallback breaks (guide:19), "(free)" alone understates it.
    4. Add to the Verification an assertion of the negative case (no notice for a conversation that never had a selection), guarding against a vacuous pass.

    Duplicates: none — #159 is the adjacent config-entry gap on a different surface, as stated.

    Verdict: valid — stays open.

  3. bencode commented on Oct 25, 2026

    @bencode
    OwnerAuthor

    Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against main@90b046f. Verdict: valid, anchor drifted — corrected anchors below; behavior unchanged.

    Evidence audit: the background-conversations work (PR #198, 5489f17/e3e4447) refactored two cited files, but every claim still holds:

    • Silent fallback intact — core/models/model-selection.ts:15-23 untouched: requested model not found ⇒ ?? default match; phase: 'unavailable' now at agent-session.ts:105 (was :100); resolution now at :110 (was :105).
    • The stored selection is still replaced by the fallback — agent-session.ts:132: setConversation(s, { ...conversation, selection: selectionFromState(state) }) (was :127 via setActive). Sharpening Start with sample documents, add local resources progressively, and save explicitly #1's trigger constraint survives the refactor: capture conversation.selection before :110, since by :132 it is already the fallback.
    • Quiet-status surface exists — conversation-panel.tsx:192: <p className="conversation-notice" role="status"> (was :127-131, now inside composer-area).
    • Unchanged: model-providers/index.tsx:173-177 (remove leaves selections stale), model-control/index.tsx:50-57 ("(your key)"/"(free)"), the guide's promise, byok.test.tsx:32.

    Duplicate check: none — #184 (remember the choice for new conversations) is the adjacent family, distinct from this issue's notice when a stored selection fell back.

    Sensor: lint ✓; verify ✗ as it should (no longer configured absent from main). Honest gate, no repair needed.

    Verdict: valid, stays open. All four first-review sharpenings stand unchanged; the PR #198 refactor only moved line numbers.

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