Repository navigation
feat: conversations keep answering in the background, with a list to switch between them - #198
Merged
Merged
Conversation
…eeps answering in the background
…arking those answering and those with an unseen reply
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several conversations can now run at once. Switching away from a conversation no longer stops its reply; it keeps answering in the background. Clicking the conversation's name at the top of the assistant panel opens a list of recent conversations to switch between. The interaction was settled with a clickable prototype (option A).
Behavior
+, History and Close buttons are as before. There is no limit on how many conversations run at once. Reloading the page still aborts any reply in progress, as before.Implementation
Commit 1: multiple conversations in the controller (no UI). The controller used to treat "one store, one runtime" as the open conversation. It now separates two levels:
Session): its own store (conversation, draft, messages, phase), runtime (agent, run state) and draft queue.ConversationState): which conversation is open, the background activity marks (activity), the model configuration and history.The
SessionCtxtype ties these together. The run, draft, compaction, title and settings modules now each operate on a single session. In memory the controller keeps only the open conversation plus those answering; when a background reply finishes, that conversation is markedunreadand released.navigation.tsswitches in this order: save the draft, activate the target, release the previous session. The open session is therefore always in memory. A conversation still in memory is taken and activated synchronously, so a reply finishing at that moment cannot release it first.controller.storeis now a view store: controller state plus the open session's state, kept in sync by subscription. Field names are unchanged, so the hook and the existing tests need no changes.Commit 2: list UI.
recent-conversations.ts: pure functions.recentConversationspicks the rows;keepOrderholds the order fixed while the list is open.session-list.tsx: the list.session-list-preference.ts: remembers open/closed, followingpdf-reading-preferences.Verification
pnpm checkpasses on both commits. On commit 1, no existing test changed: switching,/clear, queueing and stop tests all pass.recent-conversations.test.ts: limiting to 10; keeping older conversations that are open or answering; an unsaved conversation going on top; holding the order.+to create B and write a draft. The list shows A with a spinner; when the reply is released, A shows a dot; switching to A shows the full reply and clears the dot; switching back to B, the draft is still there.