Skip to content

feat: continue the last session of the folder on connect - #67

Open
Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/resume-latest
Open

Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/resume-latest

Conversation

@Moep90

@Moep90 Moep90 commented Sep 1, 2026

Copy link
Copy Markdown

Problem

Connecting to an agent always opened an empty session. The previous work sat behind the Agents view: connect, expand the agent, wait for the list to load, pick the session. Someone who does not know that path sees an empty chat and concludes the history is gone, which is what happened to me after a window reload.

The session list is also filtered by the workspace folder, which is the right behavior but makes an empty list ambiguous: it looks the same whether there is no history or whether the history belongs to another folder.

Change

Connecting asks the agent for the sessions of the current folder and continues the most recent one, replaying it through session/load or session/resume, whichever the agent advertises. Load is preferred when both are available.

Every path that cannot produce a session falls back to the previous behavior of creating a fresh one: an agent without session/list, an agent that can neither load nor resume, a folder with no sessions, or a failure while listing. Agents that do none of this behave exactly as before.

Testing

npm run lint, npm test and npm run package pass locally on Linux. Three tests cover the selection of the most recently updated session including the folder filter that is passed along, the preference for load when the agent advertises both, and the three fallbacks to a fresh session.

Note

This pairs well with the session tabs PR, where an intentionally empty conversation is one click on the plus in the tab strip. It does not depend on it: without that PR, a new conversation is still reachable from the ACP: New Conversation command.

Connecting to an agent always opened an empty session, while the history
sat behind the Agents view: connect, expand the agent, wait for the list,
pick the session. Anyone who did not know that path saw an empty chat and
assumed the work was gone.

Connecting now asks the agent for the sessions of the current folder and
continues the most recent one, replaying it through load or resume,
whichever the agent advertises. A folder without sessions, an agent that
cannot list or replay, and any failure along the way all fall back to a
fresh session, so agents that do neither behave exactly as before.

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