Skip to content

修复 harness 中 memory glob 路径归一化问题#1481

Open
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1466
Open

修复 harness 中 memory glob 路径归一化问题#1481
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1466

Conversation

@guslegend0510
Copy link
Copy Markdown

概述

修复 MemoryConsolidator 在处理 memory/*.md 时对路径归一化不一致的问题,避免本地文件系统返回绝对路径或 Windows 路径时,根目录下的日记文件被漏读、漏合并。

变更内容

  • 新增 WorkspaceManager.toWorkspaceRelativePath(...),统一把文件系统返回的路径转换为 workspace 相对路径。
  • MemoryConsolidator 在读取 daily ledger 时,先将 glob 结果归一化,再进行过滤、排序和读取。
  • 优化 fileName(...),兼容 Windows 路径分隔符。
  • 增加回归测试,覆盖 LocalFilesystem 下根目录 memory/2026-05-20.md 的合并场景。

验证

  • mvn -s codex-maven-settings.xml -pl agentscope-harness -am "-Dtest=MemoryConsolidatorFilesystemTest,FilesystemGlobTest" test

@guslegend0510 guslegend0510 requested a review from a team May 24, 2026 04:30
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 24, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 61.53846% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cope/harness/agent/workspace/WorkspaceManager.java 60.86% 5 Missing and 4 partials ⚠️
...scope/harness/agent/memory/MemoryConsolidator.java 62.50% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

area/harness agentscope-harness (test/runtime support) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants