singularity-forge/packages/pi-coding-agent/src/core
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
..
compaction feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
export-html fix: add missing export-html vendor files 2026-03-13 10:38:13 +01:00
extensions feat: add yaml support, run-hook command, and path sanitization (#637) 2026-03-16 09:22:23 -06:00
lsp feat(lsp): activate LSP by default, add call hierarchy/format/signature, sync edits (#639) 2026-03-16 09:22:52 -06:00
tools feat(lsp): activate LSP by default, add call hierarchy/format/signature, sync edits (#639) 2026-03-16 09:22:52 -06:00
agent-session.ts fix(session): rebuild tools when cwd changes in newSession (#633) (#638) 2026-03-16 09:23:19 -06:00
artifact-manager.ts feat: TTSR + blob/artifact storage (ported from oh-my-pi) 2026-03-13 08:43:56 -06:00
auth-storage.test.ts fix: prevent credential backoff on transport errors and handle quota exhaustion gracefully (#353) 2026-03-14 07:15:00 -06:00
auth-storage.ts feat: add cross-provider fallback when rate/quota limits are hit (#125) 2026-03-14 15:45:44 -05:00
bash-executor.ts feat: native Rust bash stream processor for single-pass chunk processing (#271) 2026-03-13 16:34:17 -06:00
blob-store.ts feat: TTSR + blob/artifact storage (ported from oh-my-pi) 2026-03-13 08:43:56 -06:00
defaults.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
diagnostics.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
discovery-cache.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
discovery-cache.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
event-bus.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
exec.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
fallback-resolver.test.ts feat: add cross-provider fallback when rate/quota limits are hit (#125) 2026-03-14 15:45:44 -05:00
fallback-resolver.ts feat: add cross-provider fallback when rate/quota limits are hit (#125) 2026-03-14 15:45:44 -05:00
footer-data-provider.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
index.ts feat: add cross-provider fallback when rate/quota limits are hit (#125) 2026-03-14 15:45:44 -05:00
keybindings.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
messages.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
model-discovery.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-discovery.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-registry-discovery.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-registry.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-resolver.ts feat: default to Opus 4.6 1M context variant (#565) 2026-03-15 18:57:46 -06:00
models-json-writer.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
models-json-writer.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
package-manager.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
prompt-templates.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
resolve-config-value.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
resource-loader.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
sdk.ts chore(M003/S04): auto-commit after reassess-roadmap 2026-03-15 08:33:13 -06:00
session-manager.test.ts perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
session-manager.ts perf: optimize discovery and interactive hot paths 2026-03-14 16:03:44 -05:00
settings-manager.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
skills.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
slash-commands.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
system-prompt.ts feat(lsp): activate LSP by default, add call hierarchy/format/signature, sync edits (#639) 2026-03-16 09:22:52 -06:00
timings.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00