openclaw - ✅(Solved) Fix [Bug]: Context compression corrupts file paths containing / character [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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#75058Fetched 2026-05-01 05:38:35
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Timeline (top)
commented ×2cross-referenced ×1labeled ×1

When the conversation context grows long and needs to be compressed, the / character in file paths (e.g. /root/workspace/...) is incorrectly converted to a space, corrupting the path (e.g. /root/workspace/ skills/ ...).

Error Message

2026-04-30T11:26:50.187Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md"} 2026-04-30T11:26:50.202Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md"} 2026-04-30T11:30:13.135Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md"} 2026-04-30T11:30:21.009Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL.

Root Cause

When the conversation context grows long and needs to be compressed, the / character in file paths (e.g. /root/workspace/...) is incorrectly converted to a space, corrupting the path (e.g. /root/workspace/ skills/ ...).

Fix Action

Fixed

PR fix notes

PR #75093: fix(agents): preserve exact paths during compaction

Description (problem / solution / changelog)

Fixes #75058.

Summary

  • Collect path-like literals from model-facing compaction input, previous summary, and file-operation metadata without serializing hidden tool-result details.
  • Append a bounded deterministic <exact-path-literals> suffix so slash-separated paths survive provider and LLM compaction unchanged.
  • Add regression coverage for URL exclusion, unescaped Windows paths, tool-result detail filtering, and provider compaction output preserving an exact absolute path.

Validation

  • pnpm exec oxfmt --check --threads=1 src/agents/pi-hooks/compaction-safeguard.ts src/agents/pi-hooks/compaction-safeguard.test.ts src/agents/compaction.tool-result-details.test.ts
  • pnpm test src/agents/pi-hooks/compaction-safeguard.test.ts src/agents/compaction.tool-result-details.test.ts -- --reporter=verbose
  • pnpm check:changed
  • git diff --check

AI-assisted with OpenAI Codex.

Changed files

  • src/agents/pi-hooks/compaction-safeguard.test.ts (modified, +115/-0)
  • src/agents/pi-hooks/compaction-safeguard.ts (modified, +127/-0)

Code Example

2026-04-30T11:26:50.187Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md"}

2026-04-30T11:26:50.202Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md"}

2026-04-30T11:30:13.135Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md"}

2026-04-30T11:30:21.009Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When the conversation context grows long and needs to be compressed, the / character in file paths (e.g. /root/workspace/...) is incorrectly converted to a space, corrupting the path (e.g. /root/workspace/ skills/ ...).

Steps to reproduce

Perform operations using full file paths in the conversation Conversation grows long enough to trigger context compression After compression, paths received by tool calls are corrupted — / becomes a space

Expected behavior

The / character in paths should remain unchanged.

Actual behavior

/root/workspace/skills/... → /root/workspace/ skills/ ... (/ becomes space)

OpenClaw version

v2026.04.26

Operating system

Linux 5.15.0 Node.js v24.15.0 OpenClaw latest

Install method

No response

Model

Minimax

Provider / routing chain

minimax-m2.7

Additional provider/model setup details

No response

Logs, screenshots, and evidence

2026-04-30T11:26:50.187Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ Rules. md"}

2026-04-30T11:26:50.202Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md' raw_ params={"path":"/root/workspace/ skills/ openclaw- cybersecurity- skills/ CONVERSION_ LIST. md"}

2026-04-30T11:30:13.135Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md"}

2026-04-30T11:30:21.009Z error [tools] read failed: ENOENT: no such file or directory, access '/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL. md' raw_ params={"path":"/root/workspace/ skills/ Anthropic- Cybersecurity- Skills/ skills/ building- threat- hunt- hypothesis- framework/ SKILL.

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by properly encoding or escaping the / character in file paths before compression to prevent it from being converted to a space.

Guidance

  • Review the conversation context compression logic to identify where the / character is being replaced with a space and modify it to preserve the original path.
  • Consider using URL encoding or a similar mechanism to escape special characters like / in file paths before compression.
  • Verify that the tool calls receiving the compressed paths can handle the escaped or encoded characters correctly.
  • Test the fix with various file paths containing / characters to ensure the issue is fully resolved.

Example

No specific code snippet can be provided without knowing the exact implementation details, but an example of URL encoding in JavaScript could be: const encodedPath = encodeURIComponent('/root/workspace/skills/');

Notes

The provided logs indicate that the issue is causing ENOENT errors due to the corrupted file paths, which suggests that the fix should focus on preserving the original path characters during compression.

Recommendation

Apply a workaround by encoding or escaping the / character in file paths before compression, as upgrading to a fixed version is not mentioned as an option in the issue.

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…

FAQ

Expected behavior

The / character in paths should remain unchanged.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Context compression corrupts file paths containing / character [1 pull requests, 2 comments, 3 participants]