Goose CLI: Working dir not properly set for new sessions
Describe the bug
When running goose for the first time (new session) the working path is not set properly in the session file. Restoring the session will then echo a warning like so WARNING: The original working directory of this session was set to ...
After reviewing the session file the working_dir is set to /home/user instead of my current cwd.
To Reproduce Steps to reproduce the behavior:
- Go to any folder
- call
gooseto create a new session - Quit goose
- Resume the session
- Observe the warning
WARNING: The original working directory of this session was set to /home/francis. Your current directory is /home/francis/dots. Do you want to switch back to the original working directory?
Expected behavior goose should set the correct working_dir the first time
Screenshots
Please provide following information:
- OS & Arch: [Ubuntu WSL (Linux MTL-DB283 6.6.87.1-microsoft-standard-WSL2 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux)]
- Interface: [CLI]
- Version: [1.0.24-canary+2f8f8e5]
- Extensions enabled: [developper, fetch, memory]
- Provider & Model: [github_copilot]
I just opened a small PR that should address this if I haven't missed something.
Im also seeing this, on both mac and linux.
It's annoying because every time I resume a session, I get prompted like below and have to be careful to select NO
◇ WARNING: The original working directory of this session was set to /Users/<me>. Your current directory is /Users/<me>/... . Do you want to switch back to the original working directory?
Even when Im always in the code dir, not home. I can confirm all the session jsonl files have the first line showing the working_dir as my home dir.
I'm having the same issue where the warning always shows when resuming a session. https://github.com/block/goose/issues/2790#issuecomment-3075104330