Repository navigation
Description
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);Activityis only'running' | 'unread'(use-conversation/state.ts:47), andSessionListrenders 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 whereagent.promptthrows does worse: the reason is written to the session store (run.ts:62-73) and nowhere else.releaseSessionthen drops the session (use-conversation/agent-session.ts:184-194), andopenSessionseeds 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) orfailedRun(agent)(run.ts:76-79), keeping'unread'for delivered answers. - Render it in
SessionListas 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
- ui-packages/web/src/features/conversation/use-conversation/run.ts:31-36 —
settlemarks every background end'unread', failure or not - ui-packages/web/src/features/conversation/use-conversation/run.ts:62-73,76-79 — both failure paths fall through to that settle; the thrown reason reaches only the session store
- ui-packages/web/src/features/conversation/use-conversation/state.ts:47 —
Activityhas no failure value - ui-packages/web/src/features/conversation/session-list.tsx:47-54 — the only two badges, "Answering" and "New reply"
- ui-packages/web/src/features/conversation/use-conversation/agent-session.ts:173-183,184-194 —
openSessionseeds no error;releaseSessiondrops the session that held it - ui-packages/web/src/features/conversation/use-conversation/messages.ts:71-85 — the one durable failure record today, the
stopReason === 'error'bubble - PR feat: conversations keep answering in the background, with a list to switch between them #198 (da3dfad) — background conversations, the feature this gap belongs to
- Persist the exchange while it happens — a crash or phone tab-kill mid-answer loses the question and the partial reply, leaving a titled conversation that opens empty #197 — persisting the exchange while it happens; adjacent durability concern for the same runs
- Long conversations hit the context wall silently — every follow-up then fails, with no warning and no repair path #70 (closed) — the silent-failure family for the open conversation; this is its background counterpart
- ui-packages/web/PRODUCT.md, Accessibility & Inclusion — "status messages that do not rely on color alone": a failure needs its own mark and label
Activity
bencode commentedon Oct 23, 2026
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—settlemarks any background end'unread'(lines 30-36); both failure paths (thecatchwriting the reason only into the session store at ~62-73, andfailedRun(agent)at ~76-79) return into thefinally, which callssettle— a dead run is indistinguishable from a delivered one.state.ts:47—Activity = 'running' | 'unread', no failure value;session-list.tsx:47-54renders exactly the two badges ("Answering" spinner, "New reply" dot).openSessionseeds'connecting'with no error (agent-session.ts:173-183),releaseSessiondeletes the session that held the thrown reason (:184-194); thestopReason === 'error'bubble (messages.ts:71-85) is the only durable failure record;activateclears'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
verifypassed vacuously — the original Verification block was suite-runs only, green on main while the feature is demonstrably absent (Activitystill 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.