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