goose icon indicating copy to clipboard operation
goose copied to clipboard

Goose CLI: Working dir not properly set for new sessions

Open sudo-tee opened this issue 6 months ago • 1 comments

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:

  1. Go to any folder
  2. call goose to create a new session
  3. Quit goose
  4. Resume the session
  5. 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

Image

Image

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]

sudo-tee avatar Jun 05 '25 11:06 sudo-tee

I just opened a small PR that should address this if I haven't missed something.

s-soroosh avatar Jun 05 '25 15:06 s-soroosh

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.

sam-at-block avatar Jul 15 '25 19:07 sam-at-block

I'm having the same issue where the warning always shows when resuming a session. https://github.com/block/goose/issues/2790#issuecomment-3075104330

wbontrager avatar Jul 17 '25 05:07 wbontrager