Skip to content

No-key chat is a dead end — the only 'Add your own model…' entry hides exactly when no model exists #159

Closed

Description

@bencode

Problem

The README documents a supported no-key path for self-hosters: run npx gamma-reader and add "a model added in the reader" when no GLM_API_KEY/DEEPSEEK_API_KEY is set. What that reader actually meets:

  • With zero providers, resolveModelSelection throws 'The default chat model is unavailable.' (ui-packages/web/src/core/models/model-selection.ts:23); agent-session.ts catches it and the panel shows that sentence as a red alert (conversation-panel.tsx:132) — wording that misdiagnoses the state (nothing is "unavailable"; no model is configured) and suggests no action.
  • modelConfiguration is runtime && selection ? … : null (use-conversation/index.ts:87), so with no model to select the composer hides the model control (composer/index.tsx:352) — and with it the only "Add your own model…" entry (model-control/index.tsx:66). ModelProviderDialog is rendered in exactly one place (conversation-panel.tsx:197) and is triggered only through that hidden select. The repair path is unreachable from the UI.
  • Phase 'error' also disables sending (composer/index.tsx:122), so the chat surface is an inert composer, a misleading error, and no way forward except documentation the reader doesn't have.

PRODUCT.md says readers who hold their own keys "can configure them… that path is open, not hidden", and the design principle is "leaving configuration reachable for those who want it". This state hides it precisely for the reader who needs it.

Proposal

  • When no model is available, show an explicit affordance in the composer area — e.g. an "Add a model to chat" button — that opens ModelProviderDialog, independent of the model select's existence.
  • Word the zero-provider state for what it is and what to do: "No chat model is configured. Add your own key to chat." instead of "The default chat model is unavailable."
  • Keep send disabled in this state, but make the fix one click from where the reader is standing.

Goal

After this, a reader on a deployment without environment keys opens the assistant, reads why chat is inert, and reaches model configuration from that same surface — adding a key and chatting without leaving the app or consulting the docs.

Verification

# panel test: with an empty provider list, the composer area offers a control that
# opens the model dialog, and the notice names the unconfigured-model state
cd ui-packages/web && pnpm vitest run --project unit src/features/conversation/conversation-panel.test.tsx

Refs

  • ui-packages/web/src/core/models/model-selection.ts:23 — the throw and its message
  • ui-packages/web/src/features/conversation/use-conversation/index.ts:87 + composer/index.tsx:352 — control hidden exactly when no model exists
  • ui-packages/web/src/features/conversation/model-control/index.tsx:66 — the only "Add your own model…" entry
  • ui-packages/web/src/features/conversation/conversation-panel.tsx:197 — the dialog's single render site
  • README.md "Three ways to use it" / Configuration — the no-key self-host path this reader is on
  • PRODUCT.md Users + "Keep the first run free of configuration, while leaving configuration reachable"
  • Adjacent in spirit to Teach import paths and assistant capabilities at the empty states, not only in the README #39 (teach at the point of need) — this is the chat surface's version of that, for the model instead of the library

Activity

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

    @bencode
    OwnerAuthor

    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:scheduled proposals. Audited against main@ebb0ee0.

    Evidence audit: every citation confirmed to the exact line.

    • ✅ model-selection.ts:23 — throw new Error('The default chat model is unavailable.'), verbatim.
    • ✅ The full dead-end chain holds: agent-session.ts:105-112 catches the throw and sets phase 'unavailable' with the message; use-conversation/index.ts:87 — modelConfiguration: runtime && selection ? … : null; composer/index.tsx:352 gates ConversationModelControl on it (and :122 — canSend requires phase === 'ready' || 'running'); model-control/index.tsx:66 is the only Add your own model… option, inside that hidden select; conversation-panel.tsx:197 is the sole ModelProviderDialog render site (grep-verified across non-test source).
    • ✅ README:37 documents the exact state this strands ("or a model added in the reader"); PRODUCT.md:40 says "leaving configuration reachable for those who want it" — this state hides it for exactly that reader.

    Duplicate check: none (model/provider/key topics have no other open or closed issue). Sensor: lint ✓, verify ✗ — failing for the right reason: conversation-panel.test.tsx does not exist yet ("No test files found"), so the anchor passes only when the described test is written and passes. No repair needed (unlike #157/#158 last beat, whose anchors passed on unmodified main).

    Verdict: valid, keep open. Two sharpening suggestions for implementation:

    1. conversation-panel.tsx:197-203 already notes a real gotcha — models added in the dialog only reach the list after a runtime rebuild. The new test should cover the full repair arc (empty providers → affordance → dialog → key added → composer becomes usable), not just the affordance's existence.
    2. The rewording target should also cover agent-session.ts's 'unavailable' phase handling — replacing the string at model-selection.ts:23 alone changes what the alert says but not what phase: 'unavailable' means elsewhere; keep the state name and change the words at the surface.
  3. bencode commented on Oct 24, 2026

    @bencode
    OwnerAuthor

    Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Against main@90b046f (20 commits since the last review at ebb0ee0; the composer/use-conversation refactor bd00cf0/1089324 and the session split land squarely in this issue's files).

    Evidence audit: the dead-end premise is intact, but the citation chain has moved, and one wording premise drifted.

    • ✅ Core premise holds to the new homes: modelConfiguration is runtime && selection ? … : null (use-conversation/index.ts:90); the model control is gated on it (composer/composer-toolbar.tsx:76 — moved out of composer/index.tsx:352); model-control/index.tsx:66 is still the only "Add your own model…" entry, inside that hidden select; ModelProviderDialog still renders in exactly one place (conversation-panel.tsx:263, was :197); send still requires phase === ready | running (composer/draft-input.tsx:83-84, was composer/index.tsx:122). The repair path is still unreachable with zero providers.
    • 🔁 Wording drift: with zero providers the flow no longer reaches the cited throw. loadModelConfig yields ConfigState kind: unavailable (use-conversation/navigation.ts:27), agent-session.ts:105 short-circuits to phase: unavailable, and the panel shows the status "Chat is currently unavailable." (conversation-panel.tsx:94-95, role=status) — not the red "The default chat model is unavailable." alert at the cited :132. The throw itself survives verbatim at model-selection.ts:23, but it is now off the zero-provider path (it fires for a broken selection — Say when a conversation's own-key model is gone — it silently switches to the free shared allowance today #164 territory). The misdiagnosis the issue objects to is unchanged in substance: "unavailable" still names neither the state (nothing configured) nor the action.

    Sharpening for implementation: the proposal's wording half should target the phase === unavailable status branch (conversation-panel.tsx:94-95) plus the affordance, and the panel test should assert both. The first review's repair-arc suggestion (empty providers → affordance → dialog → key added → composer usable) still stands; note the dialog-added-model rebuild gotcha has also moved (conversation-panel.tsx:263 area).

    Duplicate check: none — #213/#174/#164/#184/#199 cover other model-provider gaps, not the zero-provider affordance. Sensor: lint ✓; verify ✗, deliverable-shaped (conversation-panel.test.tsx does not exist yet).

    Verdict: valid, keep open (anchors drifted with the refactor; corrections above, no body edit needed — the Verification block cites no lines).

  4. added
    state:in-progress
    on Oct 26, 2026
  5. self-assigned this
    on Oct 26, 2026
  6. added a commit that references this issue on Oct 26, 2026
  7. bencode commented on Oct 26, 2026

    @bencode
    OwnerAuthor

    ✓ Verification passed

    RUN  v5.0.0 /Users/bencode/work/gamma-reader/ui-packages/web
    
    
     Test Files  1 passed (1)
          Tests  1 passed (1)
       Start at  08:52:17
       Duration  845ms (transform 31%, environment 26%, import 17%, setup 16%, tests 10%)
    
  8. added
    state:needs-verification
    and removed
    state:in-progress
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementsource:scheduledstate:needs-verification

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions