🧩 Problem Phenomenon
When using the following workspace configuration:
Path workspace = Paths.get(".agentscope/workspace/note");
During system runtime, the memory file path returned by memory_search is resolved to an absolute path, for example:
D:/xx/AgentScope-Study/.agentscope/workspace/note/yw/memory/2026-05-19.md
🔁 Filter Logic Issue
In the memory filtering logic of the harness module, the following judgment exists:
!resolved.startsWith(this.workspace)
It further affects the final result:
!resolved.startsWith(this.workspace) ? "" : resolved
❗ Root Cause
The issue is caused by a combination of inconsistent path semantics + incorrect string judgment method:
1️⃣ resolved is an absolute path
D:/xx/AgentScope-Study/.agentscope/workspace/note/yw/memory/2026-05-19.md
2️⃣ this.workspace is a relative path
.agentscope/workspace/note
3️⃣ The string startsWith comparison becomes invalid
Resulting in:
resolved.startsWith(this.workspace) == false
4️⃣ Trigger fallback logic (Key Point)
Due to the failed filtering condition, the fallback logic is executed:
!resolved.startsWith(this.workspace) ? "" : resolved
The final result becomes:
👉 The memory file is silently discarded
💥 Actual Impact
- The return result of
memory_search is emptied
- The memory file exists but cannot be added to the context
- No exception logs (silent failure)
- More likely to be triggered on Windows (D:/)
🎯 Expected Behavior
The memory path judgment must meet the following requirements:
- Support consistency between relative/absolute workspace paths
- Avoid misjudgment caused by different path representation formats
- Memory files should be correctly identified as resources within the workspace

🧩 Problem Phenomenon
When using the following workspace configuration:
During system runtime, the memory file path returned by
memory_searchis resolved to an absolute path, for example:🔁 Filter Logic Issue
In the memory filtering logic of the harness module, the following judgment exists:
It further affects the final result:
❗ Root Cause
The issue is caused by a combination of inconsistent path semantics + incorrect string judgment method:
1️⃣
resolvedis an absolute path2️⃣
this.workspaceis a relative path3️⃣ The string
startsWithcomparison becomes invalidResulting in:
4️⃣ Trigger fallback logic (Key Point)
Due to the failed filtering condition, the fallback logic is executed:
The final result becomes:
👉 The memory file is silently discarded
💥 Actual Impact
memory_searchis emptied🎯 Expected Behavior
The memory path judgment must meet the following requirements: