Skip to content

Your lightweight open-source personal agent.

fix: pass workspace to file tools in subagent

Re-bine17342ddfc81
diff --git a/nanobot/agent/subagent.py b/nanobot/agent/subagent.py
index 767bc68b4..d87c61a5d 100644
--- a/nanobot/agent/subagent.py
+++ b/nanobot/agent/subagent.py
@@ -103,10 +103,10 @@ class SubagentManager:
# Build subagent tools (no message tool, no spawn tool)
tools = ToolRegistry()
allowed_dir = self.workspace if self.restrict_to_workspace else None
- tools.register(ReadFileTool(allowed_dir=allowed_dir))
- tools.register(WriteFileTool(allowed_dir=allowed_dir))
- tools.register(EditFileTool(allowed_dir=allowed_dir))
- tools.register(ListDirTool(allowed_dir=allowed_dir))
+ tools.register(ReadFileTool(workspace=self.workspace, allowed_dir=allowed_dir))
+ tools.register(WriteFileTool(workspace=self.workspace, allowed_dir=allowed_dir))
+ tools.register(EditFileTool(workspace=self.workspace, allowed_dir=allowed_dir))
+ tools.register(ListDirTool(workspace=self.workspace, allowed_dir=allowed_dir))
tools.register(ExecTool(
working_dir=str(self.workspace),
timeout=self.exec_config.timeout,