Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(subagent): add edit_file tool and time context to sub agent
Re-binde3324807fd5
diff --git a/README.md b/README.mdindex fed25c83c..ea606deeb 100644--- a/README.md+++ b/README.md@@ -16,7 +16,7 @@⚡️ Delivers core agent functionality in just **~4,000** lines of code — **99% smaller** than Clawdbot's 430k+ lines.-📏 Real-time line count: **3,510 lines** (run `bash core_agent_lines.sh` to verify anytime)+📏 Real-time line count: **3,578 lines** (run `bash core_agent_lines.sh` to verify anytime)## 📢 Newsdiff --git a/nanobot/agent/subagent.py b/nanobot/agent/subagent.pyindex 6113efb3b..9e0cd7cb3 100644--- a/nanobot/agent/subagent.py+++ b/nanobot/agent/subagent.py@@ -12,7 +12,7 @@ from nanobot.bus.events import InboundMessagefrom nanobot.bus.queue import MessageBusfrom nanobot.providers.base import LLMProviderfrom nanobot.agent.tools.registry import ToolRegistry-from nanobot.agent.tools.filesystem import ReadFileTool, WriteFileTool, ListDirTool+from nanobot.agent.tools.filesystem import ReadFileTool, WriteFileTool, EditFileTool, ListDirToolfrom nanobot.agent.tools.shell import ExecToolfrom nanobot.agent.tools.web import WebSearchTool, WebFetchTool@@ -101,6 +101,7 @@ class SubagentManager:allowed_dir = self.workspace if self.restrict_to_workspace else Nonetools.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(ExecTool(working_dir=str(self.workspace),@@ -210,12 +211,17 @@ Summarize this naturally for the user. Keep it brief (1-2 sentences). Do not mendef _build_subagent_prompt(self, task: str) -> str:"""Build a focused system prompt for the subagent."""+ from datetime import datetime+ import time as _time+ now = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")+ tz = _time.strftime("%Z") or "UTC"+return f"""# Subagent-You are a subagent spawned by the main agent to complete a specific task.+## Current Time+{now} ({tz})-## Your Task-{task}+You are a subagent spawned by the main agent to complete a specific task.## Rules1. Stay focused - complete only the assigned task, nothing else@@ -236,6 +242,7 @@ You are a subagent spawned by the main agent to complete a specific task.## WorkspaceYour workspace is at: {self.workspace}+Skills are available at: {self.workspace}/skills/ (read SKILL.md files as needed)When you have completed the task, provide a clear summary of your findings or actions."""