From 85fdd7ba14020b4c31ba1e28f16d66f9fc8af0f9 Mon Sep 17 00:00:00 2001 From: hobostay Date: Thu, 12 Mar 2026 16:53:42 +0800 Subject: [PATCH] fix: include TOOLS.md in agent context TOOLS.md was listed in openclaw's migrateable files but was never actually loaded into the agent context. This commit adds TOOLS.md to: 1. LoadBootstrapFiles() - reads and injects TOOLS.md content into system prompt 2. sourcePaths() - tracks TOOLS.md for cache invalidation Now users can document custom tool usage instructions in TOOLS.md and they will be properly included in the LLM context. Fixes #1315 Co-Authored-By: Claude Opus 4.6 --- pkg/agent/context.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/agent/context.go b/pkg/agent/context.go index 5a84c45e2..caf431e95 100644 --- a/pkg/agent/context.go +++ b/pkg/agent/context.go @@ -227,6 +227,7 @@ func (cb *ContextBuilder) sourcePaths() []string { filepath.Join(cb.workspace, "SOUL.md"), filepath.Join(cb.workspace, "USER.md"), filepath.Join(cb.workspace, "IDENTITY.md"), + filepath.Join(cb.workspace, "TOOLS.md"), filepath.Join(cb.workspace, "memory", "MEMORY.md"), } } @@ -437,6 +438,7 @@ func (cb *ContextBuilder) LoadBootstrapFiles() string { "SOUL.md", "USER.md", "IDENTITY.md", + "TOOLS.md", } var sb strings.Builder