Skip to content

Workspace switch can report the wrong active worktree #721

Description

@yxlyx

Problem

After switching between Git worktrees, the workspace tool can report one worktree as active while shell and file tools continue using another worktree. The workspace listing can also mark the wrong worktree as active.

Generic reproduction

  1. Start a session in any repository with a primary worktree and a secondary worktree.
  2. Use the workspace switch tool to select the secondary worktree.
  3. Confirm with a shell command that the current directory is the secondary worktree.
  4. Use the workspace switch tool to select the primary worktree again.
  5. The tool can report that the primary worktree is active while subsequent shell commands still run in the secondary worktree.
  6. The workspace listing can mark the primary worktree as active even though the actual process directory remains the secondary worktree.

In some switches, the displayed target path can also render as corrupted text even though commands run in the selected worktree.

Expected

The workspace switch should update the process directory used by shell and file tools, and the workspace listing should mark that same worktree as active. If switching fails, the tool should report the failure rather than reporting the target as active.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions