From ddd45653808999fe0ae48cc091618ff9f65007f3 Mon Sep 17 00:00:00 2001 From: viettranx Date: Fri, 13 Mar 2026 16:15:33 +0700 Subject: [PATCH] fix(tools): add negative guidance for message tool and disable handoff by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message tool prompting now explicitly tells the LLM not to use it for replying to the user — prevents false activations on phrases like "gởi lại cho tôi" (send it back to me). Handoff tool disabled by default since it's rarely used and causes confusion with spawn. Admins can re-enable via DB/UI if needed. --- cmd/gateway_builtin_tools.go | 2 +- internal/agent/systemprompt.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/gateway_builtin_tools.go b/cmd/gateway_builtin_tools.go index 1bb82850..42e0e362 100644 --- a/cmd/gateway_builtin_tools.go +++ b/cmd/gateway_builtin_tools.go @@ -113,7 +113,7 @@ func builtinToolSeedData() []store.BuiltinToolDef { {Name: "evaluate_loop", DisplayName: "Evaluate Loop", Description: "Run a generate→evaluate→revise loop between two agents for quality-critical output", Category: "delegation", Enabled: true, Requires: []string{"managed_mode", "agent_links"}, }, - {Name: "handoff", DisplayName: "Handoff", Description: "Transfer the conversation to another agent — the user will talk directly to that agent", Category: "delegation", Enabled: true, + {Name: "handoff", DisplayName: "Handoff", Description: "Transfer the conversation to another agent — the user will talk directly to that agent", Category: "delegation", Enabled: false, Requires: []string{"managed_mode", "agent_links"}, }, diff --git a/internal/agent/systemprompt.go b/internal/agent/systemprompt.go index fc2180ca..327a0c1a 100644 --- a/internal/agent/systemprompt.go +++ b/internal/agent/systemprompt.go @@ -70,7 +70,7 @@ var coreToolSummaries = map[string]string{ "browser": "Browse web pages interactively", "tts": "Convert text to speech audio", "edit": "Edit a file by replacing exact text matches", - "message": "Send a message to a channel (Telegram, Discord, etc.)", + "message": "Send a PROACTIVE message to another channel/chat — do NOT use this to reply to the user, just respond directly", "sessions_list": "List sessions for this agent", "session_status": "Show session status (model, tokens, compaction count)", "sessions_history": "Fetch message history for a session",