Skip to content

Folder doesn't follow a chat isolated in a multi-chat session after the agent host restarts #349954

Todo

Description

In an editor window with chat.editorWindow.enableWorktree on, the window's folder follows the shown chat into the worktree that chat works in. When one chat of a session with several chats is isolated into a new worktree (for example with the agent's isolate_session tool), the folder follows it and the worktree is listed under Folder Location > Worktrees. This relies on the session summary's vscode.isolatedChatWorktrees _meta entry, which the agent host publishes as it isolates or restores such a chat.

After the agent host restarts, this no longer works for such a chat until the session's marker reaches the window again:

Steps:

  1. In a folder window with chat.editorWindow.enableWorktree on, start an agent host chat, add a second chat to its session, and isolate the first chat into a new worktree. The folder follows it.
  2. Quit and relaunch VS Code, so that the agent host restarts.
  3. Open the isolated chat again.

Expected: the folder moves to that chat's worktree, and the worktree is listed under Folder Location > Worktrees.
Actual: the folder stays where it is, and the worktree is not listed.

Cause: the session list the window holds is the agent host catalog's summary, which the host rebuilds from persisted session values after a restart. The vscode.isolatedChatWorktrees marker is published only on the live session state and isn't persisted, so the catalog summary doesn't carry it, and the provider doesn't offer the worktree.

Proposed fix: persist the marker as a central session value (agentHostSessionStateMirror) and project it into the catalog summary on listing, with restart and older-build coverage.

Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions