fix(auto-reply): allow message tool for media/file sends in group chats#31410
fix(auto-reply): allow message tool for media/file sends in group chats#31410zerone0x wants to merge 1 commit into
Conversation
In group-chat sessions (including Telegram forum topics), the persistent system-prompt context block told the model: "Do not use the message tool to send to this same group — just reply normally." The intent was to prevent duplicate text messages (the reply pipeline delivers text automatically). However, the model interpreted this as a blanket prohibition, including for file attachments and media. When asked to send a file in a forum topic the agent responded with something like "message tool disabled in this chat". Fix: update the instruction to distinguish plain-text replies (still routed automatically, no message tool needed) from media/file sends (which require the message tool with action=send + media/filePath). The updated wording mirrors the existing system-prompt guidance that already explains the NO_REPLY pattern for when the message tool delivers the reply. Fixes #31368 Co-Authored-By: Claude <noreply@anthropic.com>
Greptile SummaryThis PR fixes a usability issue where users in group chats (Telegram forum topics, Discord channels, etc.) couldn't send files or media because the system prompt blocked all use of the message tool. The fix updates one line in
The change preserves the original intent of preventing duplicate text echoes while unblocking legitimate file/media sends. The updated instruction references correct tool parameters verified in Key points:
Confidence Score: 5/5
Last reviewed commit: 162bc37 |
|
Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
Summary
"Do not use the message tool to send to this same group — just reply normally."— intended to suppress duplicate text echoes, but the model read it as a blanket prohibition on the message tool, including for file and media attachments.tools.allow: ["*"]andactions.sendMessage: true. The exec-tool workaround is the only option today.buildGroupChatContext()(src/auto-reply/reply/groups.ts) to clarify the distinction: plain-text replies go through the normal reply pipeline (no message tool), while file/media sends still need the message tool (action=sendwithmedia/filePath).resolveTelegramAutoThreadId()already injects the correctmessage_thread_idwhen the message tool targets the originating forum topic — no changes needed there.Fixes #31368
Change Type (select all)
Scope (select all touched areas)
Testing
src/auto-reply/continue to pass.buildGroupChatContextcovering both the text-only and media cases can be added in follow-up.🤖 Generated with Claude Code