From 1c66b8be92149eeb167260e60a39bb7c001aa4d8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 17 Jan 2026 00:08:48 +0000 Subject: [PATCH] fix: hint NO_REPLY after message tool send --- src/agents/system-prompt.test.ts | 1 + src/agents/system-prompt.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index e63900ef9..cfed9fb45 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -216,6 +216,7 @@ describe("buildAgentSystemPrompt", () => { expect(prompt).toContain("message: Send messages and channel actions"); expect(prompt).toContain("### message tool"); + expect(prompt).toContain("respond with ONLY: NO_REPLY"); }); it("includes runtime provider capabilities when present", () => { diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 7c53e501d..dc5c289d5 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -95,6 +95,7 @@ function buildMessagingSection(params: { "- Use `message` for proactive sends + channel actions (polls, reactions, etc.).", "- For `action=send`, include `to` and `message`.", `- If multiple channels are configured, pass \`channel\` (${params.messageChannelOptions}).`, + `- If you use \`message\` (\`action=send\`) to deliver your user-visible reply, respond with ONLY: ${SILENT_REPLY_TOKEN} (avoid duplicate replies).`, params.inlineButtonsEnabled ? "- Inline buttons supported. Use `action=send` with `buttons=[[{text,callback_data}]]` (callback_data routes back as a user message)." : params.runtimeChannel