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
- Start a session in any repository with a primary worktree and a secondary worktree.
- Use the workspace switch tool to select the secondary worktree.
- Confirm with a shell command that the current directory is the secondary worktree.
- Use the workspace switch tool to select the primary worktree again.
- The tool can report that the primary worktree is active while subsequent shell commands still run in the secondary worktree.
- 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.
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
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.