#fs.write reports "success" on silently discarded writes (workspaceOnly=true)

1 messages Β· Page 1 of 1 (latest)

graceful forge
#

Is this intentional or should I work on a PR?

I have multiple agents with separate workspaces (e.g. /home/openclaw/.openclaw/worspace and /home/openclaw/.openclaw/workspace-agent2). When agent2 tried to write, it was defaulting to the main agent workspace. The fs.write lied returning success even though policy denied the write. I think I can fix the problem with agent2 but should fs.write lie?

Another case where I hit this was early where I wanted the main agent to perform a task using a folder other than the workspace (e.g. /home/openclaw/work). The agent claimed that it wrote files to that path but no files were present. fs.write had lied in that case as well. I fixed it with a config change to allow writing there, but why would fs.write lie?

leaden mothBOT
#

Let me verify the docs and source so I don't make up behavior.

#

Short version, no, fs.write should not lie.

On current main, this looks like a bug, not intentional behavior:

  • non-default agents are supposed to resolve their own workspace, not fall back to the main agent workspace
  • with tools.fs.workspaceOnly=true, writes outside the resolved workspace should error, not return success

I checked the current source and tests:

  • resolveAgentWorkspaceDir(...) is agent-specific
  • workspace-only write escapes are tested to throw Path escapes workspace root, not succeed

So if you can still repro this on current main, I would absolutely treat it as PR-worthy.

First thing though, can you share:

#
openclaw --version

This area changed, so version matters a lot here.

My guess is there are really 2 bugs:

  1. agent2 is getting the wrong workspace root
  2. denied fs.write is being surfaced as success instead of a tool error

Relevant docs:

If you paste the exact tool result or log snippet, I can help narrow down whether the lie is in the tool layer itself, or the model saw an error and then narrated a fake success anyway.

#

If it’s solved, please right-click the solution message β†’ Apps β†’ βœ… Mark Solution so Answer Overflow can index it. πŸŽ‰