fix(auto-reply): allow message tool for attachments in group-chat sessions#465
Open
BingqingLyu wants to merge 5 commits into
Open
fix(auto-reply): allow message tool for attachments in group-chat sessions#465BingqingLyu wants to merge 5 commits into
BingqingLyu wants to merge 5 commits into
Conversation
之前 buildGroupChatContext 生成的提示词完全禁止 AI 在群组中 使用 message 工具('Do not use the message tool to send to this same group'),导致无法向 Telegram 群组/话题发送文件、图片等 附件,即便路由基础设施已支持同聊天室 message 工具的自动 threadId 注入(resolveTelegramAutoThreadId / resolveSlackAutoThreadId)。 修改提示词,区分两种场景: - 文本回复:直接回复即可,无需 message 工具 - 附件/文件/图片:允许,并指引使用 message 工具发送到同一群组 新增 buildGroupChatContext 单元测试覆盖以上两条路径。 Closes openclaw#43146
type import must come before value import per oxfmt rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
esolveTelegramAutoThreadId) and Slack (via
esolveSlackAutoThreadId). The injected instruction contradicted that capability, causing 100% repro failure for attachment workflows in group sessions.
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Agents in Telegram (and other) group-chat sessions can now send files, images, and attachments back into the same group using the message tool, instead of being silently blocked by the system prompt.
Security Impact (required)
Repro + Verification
Environment
Steps
Tests
Added src/auto-reply/reply/groups.test.ts with 6 unit tests covering: