Repository navigation
Description
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
resolveModelSelectionfalls 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 checkRefs
- 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
bencode commentedon Oct 22, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session.
Evidence audit (main @
ebb0ee0): all citations hold.core/models/model-selection.ts:15–23— requested model not found ⇒??default-model match; total absence is indeed the explicitphase: 'unavailable'state (agent-session.ts:100).agent-session.ts:105resolves,:127setActivewithselectionFromState(state)).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–131is a real quiet-status surface (role="status");byok.test.tsx:32title matches verbatim.Sensor: lint passed; verify failed as it should — the
no longer configuredgrep finds nothing on main. Honest gate.Sharpening suggestions:
model-selection.tshandlesrequested === undefined), and the notice must not appear for fresh conversations. Capture the pre-resolutionconversation.selectionat attach; byagent-session.ts:127the stored selection is already the fallback, so the trigger cannot be read back from state later.resolveModelSelectionreturns 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.guide:19), "(free)" alone understates it.Duplicates: none — #159 is the adjacent config-entry gap on a different surface, as stated.
Verdict: valid — stays open.
bencode commentedon Oct 25, 2026
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:core/models/model-selection.ts:15-23untouched: requested model not found ⇒??default match;phase: 'unavailable'now atagent-session.ts:105(was:100); resolution now at:110(was:105).agent-session.ts:132:setConversation(s, { ...conversation, selection: selectionFromState(state) })(was:127viasetActive). Sharpening Start with sample documents, add local resources progressively, and save explicitly #1's trigger constraint survives the refactor: captureconversation.selectionbefore:110, since by:132it is already the fallback.conversation-panel.tsx:192:<p className="conversation-notice" role="status">(was:127-131, now insidecomposer-area).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 configuredabsent 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.