Skip to content

Diff does not "follow" the agent into separate worktrees #309581

Open

Description

Testing #309111

The agent app appears to reset the working dir of an agent after every response. This leads to a confusing state where I have an agent primarily working on a worktree because it (correctly) found I had existing work on that worktree. So now I have a conversation with valuable context, but it's working from a directory outside of where it launches from, so the diff never updates.

Image

(note: screenshot shows there's no diff, but I also had the agent write a tiny diff that I would revert, which it did, and the branch state still showed nothing)

Activity

  1. added this to the Backlog milestone on Apr 13, 2026
  2. lostintangent commented on May 14, 2026

    @lostintangent
    Member

    Ben Villalobos (@benvillalobos) just to confirm: your expectation is that the Changes/Files panels would update to whatever the CWD is that the agent is currently working against? As opposed to the CWD of the project that the session started from?

  3. benvillalobos commented on May 15, 2026

    @benvillalobos
    MemberAuthor

    Yes, I would very much like that. I can see how this goes against choosing a workspace / worktree at the start of a session though, so maybe this is really a feature request for a "workspace-less" chat where the changes tab follows you through the CWD

  4. added
    feature-request
    on Nov 6, 2026
  5. alexdima commented on Nov 10, 2026

    @alexdima
    Member

    This still happens on Insiders 1.146.0-insider (macOS). I opened a Folder session on a repo and asked the agent to append a line to notes.txt in a second worktree of the same repo, next to the session folder. The agent made the edit, and git status in that worktree shows M notes.txt, but the Changes panel says "No changed files". It only tracks the session's own folder.

    309581-changes-empty-after-edit-in-other-worktree.png

    🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).

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

Metadata

Metadata

Labels

agents-changesagents-windowagents-window-gitfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions