Tools (write, read, edit, bash) capture cwd at creation time via createWriteTool(cwd), createReadTool(cwd), etc. When auto-mode enters a worktree, process.cwd() changes but tools were not recreated — they continued resolving relative paths against the original project root. This caused artifacts to be written to the main project's .gsd/ directory instead of the worktree's .gsd/ directory. The dispatcher then couldn't find the artifact at the expected worktree path and retried the unit indefinitely. Fix: detect cwd change in newSession() and call _buildRuntime() to recreate tools with the updated cwd. This is a targeted rebuild that only fires when cwd actually changed (typically once per auto-mode session when entering/exiting a worktree). Fixes #633 |
||
|---|---|---|
| .. | ||
| native | ||
| pi-agent-core | ||
| pi-ai | ||
| pi-coding-agent | ||
| pi-tui | ||