What happened?
When resuming a session from a different workspace using the "All" scope in /resume (Tab to toggle), the session's conversation history loads correctly, but the working directory is never updated. Tools continue to operate from the directory pi was originally launched from, not the directory the resumed session belongs to.
The session header stores the original cwd (e.g. {"type":"session","cwd":"/path/to/other/project",...}), but switchSession() in agent-session.ts only restores the model and thinking level instead of reading and/or applying the session's cwd.
Steps to reproduce
- Launch pi from
/project-a
- Open
/resume and press Tab to switch to the "All" scope
- Select a session that was created in
/project-b
- Ask the model to list files or run any bash command
- Observe that results reflect
/project-a, not /project-b
Expected behavior
Resuming a session from a different workspace should switch the working directory to the cwd stored in that session's header, so that tools operate in the correct project directory.
Version
0.57.1
What happened?
When resuming a session from a different workspace using the "All" scope in /resume (Tab to toggle), the session's conversation history loads correctly, but the working directory is never updated. Tools continue to operate from the directory pi was originally launched from, not the directory the resumed session belongs to.
The session header stores the original cwd (e.g.
{"type":"session","cwd":"/path/to/other/project",...}), butswitchSession()inagent-session.tsonly restores the model and thinking level instead of reading and/or applying the session's cwd.Steps to reproduce
/project-a/resumeand press Tab to switch to the "All" scope/project-b/project-a, not/project-bExpected behavior
Resuming a session from a different workspace should switch the working directory to the cwd stored in that session's header, so that tools operate in the correct project directory.
Version
0.57.1