Skip to content

fix: use virtual cwd with RealFSProvider to prevent path doubling#16

Open
ivan-tymoshenko wants to merge 1 commit intomainfrom
align-process-cwd
Open

fix: use virtual cwd with RealFSProvider to prevent path doubling#16
ivan-tymoshenko wants to merge 1 commit intomainfrom
align-process-cwd

Conversation

@ivan-tymoshenko
Copy link
Copy Markdown
Member

When using RealFSProvider (enabled via fsRootPath), relative paths passed to agent tools resolve against process.cwd() before reaching the provider. If process.cwd() overlaps with the provider root (e.g. both are
/workspace inside a sandbox), the provider prepends the root again, creating doubled paths like /workspace/workspace/foo.txt.

Additionally, the just-bash tool defaults its cwd to /home/user, causing the model to construct absolute paths like /home/user/foo.txt that map to /workspace/home/user/foo.txt — wrong and inconsistent with the VFS root.

Fixes:

  • Enable virtualCwd on the VFS and set it to / when fsRootPath is configured. This makes all relative paths resolve against / instead of process.cwd(), so foo.txt becomes /foo.txt which the provider correctly maps to
    {root}/foo.txt.
  • Pass cwd: '/' to the just-bash constructor so pwd returns / and the model uses consistent paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant