singularity-forge/packages/pi-coding-agent/src
Tom Boucher 75e82a4236 fix(session): rebuild tools when cwd changes in newSession (#633) (#638)
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
2026-03-16 09:23:19 -06:00
..
cli feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
core fix(session): rebuild tools when cwd changes in newSession (#633) (#638) 2026-03-16 09:23:19 -06:00
modes feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
resources/extensions/memory fix: replace better-sqlite3 with sql.js (WASM) to fix install on Node 25+ (#356) 2026-03-14 07:41:24 -06:00
utils feat: wire native Rust image module into image processing pipeline 2026-03-13 13:41:53 -06:00
cli.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
config.ts perf: fix synchronous I/O in hot paths (#540) 2026-03-15 16:57:22 -06:00
index.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
main.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
migrations.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00