Skip to content

Say a background reply failed — the conversation list marks a dead run 'New reply' like a delivered one today, and a thrown error's reason dies with the session that held it #206

Closed

Description

@bencode

Problem

Since a reply can keep answering in a conversation the reader has left (PR #198), the conversation list is the only place its outcome is announced — and it cannot announce a failure.

  • Every background end goes through settle, which marks the conversation 'unread' whether the run produced an answer or died (ui-packages/web/src/features/conversation/use-conversation/run.ts:31-36); Activity is only 'running' | 'unread' (use-conversation/state.ts:47), and SessionList renders exactly two badges for them: a spinner labelled "Answering" and a dot labelled "New reply" (features/conversation/session-list.tsx:47-54). A reader mid-document sees "New reply" on a conversation whose answer never arrived, and comes back expecting one.
  • A run that ends with stopReason === 'error' at least leaves a failed bubble in the transcript (use-conversation/messages.ts:71-85) — visible only after the reader happens to return. A run where agent.prompt throws does worse: the reason is written to the session store (run.ts:62-73) and nowhere else. releaseSession then drops the session (use-conversation/agent-session.ts:184-194), and openSession seeds no error (agent-session.ts:173-183), so on returning the reader finds their question back as a draft, no reply, and no explanation of what went wrong — the same silent failure Long conversations hit the context wall silently — every follow-up then fails, with no warning and no repair path #70 closed for the open conversation, now reachable in the background.

Proposal

  • Add a failure activity: in run, settle to it instead of 'unread' when the run ended on the error path (run.ts:62-73) or failedRun(agent) (run.ts:76-79), keeping 'unread' for delivered answers.
  • Render it in SessionList as a third badge distinct from the "New reply" dot, with its own label (e.g. "Reply failed") — not color alone.
  • Make the reason survive the release: record the thrown error the way stopReason === 'error' runs already record theirs, or persist it with the conversation, so reopening shows why the reply stopped. Activation clears the failure mark as it clears 'unread' today (use-conversation/navigation.ts:41-42).

Goal

After this, a reply that fails while its conversation is in the background is distinguishable from one that succeeded in the recent-conversations list, and returning to it — whichever failure mode ended the run — shows the reason it stopped; delivered answers keep the "New reply" dot unchanged.

Verification

grep -rq "Reply failed" ui-packages/web/src/features/conversation/session-list.tsx
pnpm --filter @gamma-reader/web test --silent
pnpm --filter @gamma-reader/web exec vitest run --project unit src/features/conversation/use-conversation/controller.test.ts
pnpm check

(the tests to add with the change: a run that fails after the reader switches away settles to the failure activity, not 'unread', and its reason is still rendered when the conversation is reopened — today Activity has no failure value, openSession seeds no error, and no such test can pass; plus a SessionList render showing a badge labelled for failure, distinct from "New reply")

Refs

Activity

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

    @bencode
    OwnerAuthor

    Independent review — posted by the scheduled issue-reviewer loop (independent of the authoring session), against main@90b046f.

    Evidence audit: every citation confirmed against the post-PR-#198 tree.

    • ✅ run.ts — settle marks any background end 'unread' (lines 30-36); both failure paths (the catch writing the reason only into the session store at ~62-73, and failedRun(agent) at ~76-79) return into the finally, which calls settle — a dead run is indistinguishable from a delivered one.
    • ✅ state.ts:47 — Activity = 'running' | 'unread', no failure value; session-list.tsx:47-54 renders exactly the two badges ("Answering" spinner, "New reply" dot).
    • ✅ Durability gap confirmed — openSession seeds 'connecting' with no error (agent-session.ts:173-183), releaseSession deletes the session that held the thrown reason (:184-194); the stopReason === 'error' bubble (messages.ts:71-85) is the only durable failure record; activate clears 'unread' (navigation.ts:41-42).
    • ✅ PRODUCT.md:46 — "status messages that do not rely on color alone" supports the labeled-third-badge requirement.

    Duplicate check: none — #70 (closed) is the open-conversation counterpart and correctly referenced; #197 is the adjacent persist-the-exchange concern, not an overlap.

    Sensor + a defect found: lint ✓, but verify passed vacuously — the original Verification block was suite-runs only, green on main while the feature is demonstrably absent (Activity still two-valued). Same #41/#55 anchor family; a future beat would have closed this as "implemented".

    Verification block edited (logged per policy): added as its first line

    grep -rq "Reply failed" ui-packages/web/src/features/conversation/session-list.tsx

    — pins the badge label the issue itself proposes ("e.g. 'Reply failed'"), the outcome-level test that a third, labeled badge exists; zero matches on main today. An implementation renaming the label must update this anchor with it. Re-linted ✓; verify now ✗ on main as it should be.

    Verdict: valid, keep open. Note for implementation: the two failure paths have different gaps — stopReason === 'error' already persists a failed bubble, so it needs only the badge and activation-clearing; the thrown path additionally needs its reason persisted, as the proposal already states.

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