openclaw - 💡(How to fix) Fix Bug: write tool returns success but file not created [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#84062Fetched 2026-05-20 03:44:37
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
1
Timeline (top)
labeled ×2closed ×1commented ×1

Error Message

  1. Return actual error if write fails

Fix Action

Workaround

Using exec with cat or echo works correctly:

exec(command="cat > /path/to/file << 'EOF'\ncontent\nEOF")

Code Example

# Tool call
write(path="/Users/liantian/.openclaw/workspace/test.md", content="test content")

# Tool result
Successfully wrote 12 bytes to /Users/liantian/.openclaw/workspace/test.md

# Verification
ls /Users/liantian/.openclaw/workspace/test.md
# Result: No such file or directory

---

exec(command="cat > /path/to/file << 'EOF'\ncontent\nEOF")
RAW_BUFFERClick to expand / collapse

Bug Description

The write tool returns a success message but the file is not actually created on the filesystem.

Environment

  • OpenClaw Version: 2026.5.12 (f066dd2)
  • Node Version: v22.22.0
  • OS: macOS 11 (Big Sur) - Darwin 20.6.0 (x64)
  • Shell: zsh

Steps to Reproduce

  1. Call the write tool with a file path and content
  2. Tool returns: Successfully wrote X bytes to /path/to/file
  3. Check if file exists with ls or read tool
  4. File does not exist

Expected Behavior

File should be created at the specified path with the provided content.

Actual Behavior

Tool returns success message but file is not created.

Example

# Tool call
write(path="/Users/liantian/.openclaw/workspace/test.md", content="test content")

# Tool result
Successfully wrote 12 bytes to /Users/liantian/.openclaw/workspace/test.md

# Verification
ls /Users/liantian/.openclaw/workspace/test.md
# Result: No such file or directory

Workaround

Using exec with cat or echo works correctly:

exec(command="cat > /path/to/file << 'EOF'\ncontent\nEOF")

Impact

  • High: Can cause task loss when AI agent believes file was written
  • Causes confusion and potential data loss
  • Undermines trust in tool reliability

Additional Context

This was discovered during a multi-agent workflow where Friday (main agent) was communicating with Jarvis (sub-agent) via file-based message passing. The write tool appeared to succeed multiple times but files were never created, causing communication breakdown.

Suggested Fix

  1. Verify file creation before returning success
  2. Add filesystem sync/flush after write
  3. Return actual error if write fails

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING