fix(message): share workspace path resolver

This commit is contained in:
hinotoi-agent
2026-05-15 17:19:20 +08:00
committed by Xubin Ren
parent 57d7847dc8
commit 164614ccf2
4 changed files with 52 additions and 42 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ from nanobot.agent.tools.filesystem import (
_find_match,
)
# ---------------------------------------------------------------------------
# ReadFileTool
# ---------------------------------------------------------------------------
@@ -330,7 +329,7 @@ class TestWorkspaceRestriction:
media_file = media_dir / "photo.txt"
media_file.write_text("shared media", encoding="utf-8")
monkeypatch.setattr("nanobot.agent.tools.filesystem.get_media_dir", lambda: media_dir)
monkeypatch.setattr("nanobot.agent.tools.path_utils.get_media_dir", lambda: media_dir)
tool = ReadFileTool(workspace=workspace, allowed_dir=workspace)
result = await tool.execute(path=str(media_file))