@@ -11,7 +11,6 @@ use crate::config::Config;
1111use crate :: llm:: ToolDef ;
1212use crate :: tools:: context:: ToolCtx ;
1313use crate :: tools:: file:: { AppendFile , EditFile , ListDir , ReadFile , WriteFile } ;
14- use crate :: tools:: message:: MessageTool ;
1514use crate :: tools:: result:: ToolResult ;
1615use crate :: tools:: web:: { WebFetchTool , WebSearchProvider , WebSearchTool , web_client} ;
1716
@@ -104,16 +103,20 @@ impl ToolRegistry {
104103const DEFAULT_BRAVE_MAX_RESULTS : u8 = 5 ;
105104const DEFAULT_WEB_FETCH_MAX_CHARS : u32 = 50_000 ;
106105
107- /// Build the core registry (file + message + web). Used for subagent
108- /// registries (no spawn, no cron) and as the base for the main registry.
106+ /// Build the core registry (file + web). Used as the base for both the
107+ /// main-agent registry and the subagent registry.
108+ ///
109+ /// `MessageTool` is intentionally NOT included here. It is only added to
110+ /// subagent registries, where background tasks need to push results to the
111+ /// user. In the main agent the reply is returned as text content; offering
112+ /// `message` there causes the LLM to send duplicate replies.
109113pub fn build_core_registry ( config : & Config ) -> ToolRegistry {
110114 let reg = ToolRegistry :: new ( ) ;
111115 reg. register ( ReadFile ) ;
112116 reg. register ( WriteFile ) ;
113117 reg. register ( ListDir ) ;
114118 reg. register ( EditFile ) ;
115119 reg. register ( AppendFile ) ;
116- reg. register ( MessageTool ) ;
117120
118121 let web_cfg = config. tools . as_ref ( ) . and_then ( |t| t. web . as_ref ( ) ) ;
119122 let brave_max_results = web_cfg
0 commit comments