Skip to content

feat: keep sessions running side by side in tabs - #66

Open
Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/session-tabs
Open

Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/session-tabs

Conversation

@Moep90

@Moep90 Moep90 commented Sep 1, 2026

Copy link
Copy Markdown

Problem

SessionManager.newConversation() went through disconnectAgent(), which calls killAgent(). Starting another conversation therefore killed the agent process and spawned a fresh one, so whatever the agent was working on died with it. There was no way to let one conversation finish while starting another.

Nothing in ACP requires that. An agent keeps every session of a connection, and the protocol documents concurrent sessions per agent.

Change

A new conversation now opens another session on the connection that is already there. The process is only replaced when the connection is actually gone.

The chat grew a tab strip above the banner: one tab per live session, a dot on the ones that are working, and a plus for another conversation. Switching repaints the chat from the session updates the client buffered for that session, capped at 5000 updates per session, so a tab that kept running shows what happened while it was in the background.

The prompt lifecycle is tracked per session, so a turn that ends in a background tab no longer clears the spinner of the tab on screen. Loading a stored session keeps live sessions instead of dropping them, and disconnecting an agent ends all of its sessions rather than only the one the pointer happened to hold.

The confirmation before a new conversation is gone together with the reason for it: nothing is discarded any more.

Testing

npm run lint, npm test and npm run package pass locally on Linux. Four tests cover it: a new conversation leaves the running session alive and kills no process, switching back to a live session needs no replay from the agent, disconnecting drops every session of that agent, and the tab strip renders the busy and active state and reports the clicked session.

Note on overlap

The test file brings its own JSDOM harness and adds jsdom to the dev dependencies, as #56 and #64 do. Whichever lands first, I am happy to rebase onto it and drop the duplicate harness.

A new conversation went through disconnectAgent, which killed the agent
process and started a fresh one, so whatever the agent was working on died
with it.

An agent keeps every session of a connection, so a new conversation now
opens another session on the connection that is already there. The chat
grew a tab strip: one tab per live session, a dot on the ones that are
working, and a plus button for another conversation. Switching repaints the
chat from the updates the client buffered for that session, so a tab that
kept running shows what happened while it was in the background.

The prompt lifecycle is tracked per session, so a turn that ends in a
background tab no longer clears the spinner of the tab on screen. Loading a
stored session keeps live sessions around instead of dropping them, and
disconnecting an agent ends all of its sessions.

The confirmation before a new conversation is gone with the reason for it.

Signed-off-by: moep90 <volleyballlive@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant