Repository navigation
fix(groups): use 'channel' wording in intro for ChatType channel (fixes #95645) (AI-assisted) - #95654
liuhao1024 wants to merge 3 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: #96244 already fixed the central opener/delivery wording on current main, and #95762 is the cleaner open, proof-positive, mergeable PR for the remaining full-prompt and activation wording this branch adds. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this conflicting branch and route the remaining full-prompt channel wording review to #95762 while keeping #96244 as the merged current-main base. So I’m closing this here and keeping the remaining discussion on #95762 and #96244. Review detailsBest possible solution: Close this conflicting branch and route the remaining full-prompt channel wording review to #95762 while keeping #96244 as the merged current-main base. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows channel turns still enter the shared group/channel prompt helper, and current main still has some group-specific fragments in that channel path; I did not run a live Mattermost server in this read-only review. Is this the best way to solve the issue? No. This branch is no longer the best landing path because it conflicts with current main and #95762 is the clean, proof-positive sibling for the same remaining full-prompt and activation wording. Security review: Security review cleared: The patch changes only prompt wording logic and colocated tests, with no dependency, workflow, lockfile, script, auth, secret, or package metadata changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
564c07d to
10c2523
Compare
10c2523 to
472a5f4
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
…nclaw#95645) buildGroupChatContext previously rendered 'group chat' for all non-DM conversations, including public channels where ChatType is 'channel'. This contradicted the authoritative inbound-meta block which reports chat_type: 'channel', causing agents to misidentify public channels as group chats. Use the actual ChatType to pick 'channel' or 'group chat' in the intro line. Add a test that verifies correct wording for both ChatType values. Fixes openclaw#95645
…channel ClawSweeper P2: the previous commit only changed the first sentence. This extends ChatType-aware labels (destinationLabel, participantLabel, sameDestinationLabel, taskLabel) through delivery, participant, task, and no-visible-response guidance. Strengthens test to forbid residual group-chat fragments for ChatType: channel.
buildGroupIntro unconditionally used 'every group message' even when ChatType was 'channel'. Now uses 'every channel message' for channel sessions, matching the ChatType-aware behavior already in buildGroupChatContext. - Add ChatType check to buildGroupIntro - Add test covering channel/group/mention activation modes
472a5f4 to
a69e7ac
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞✅ Reason: structured ClawSweeper close marker: close-required (sha=a69e7ac29960ba9eb1253e5cce6350b83ac8ec5b) Closed:
|
What Problem This Solves
For any non-DM Mattermost conversation — including a public channel — the system-prompt intro declares "You are in a
<provider>group chat." even whenChatTypeis"channel". This contradicts the authoritative inbound-meta block which reportschat_type: "channel", causing agents to misidentify public channels as group chats and emit the wrongchat_typein tool arguments.The first-turn activation intro (
buildGroupIntro) similarly used "every group message" unconditionally for always-on activation, even when the session was a channel.What does this PR do?
Uses the actual
ChatTypevalue to select"channel"or"group chat"wording throughout the fullbuildGroupChatContextprompt — not just the intro sentence, but also destination references, participant labels, task labels, and visible-response guidance. Also makesbuildGroupIntroChatType-aware so the activation intro uses "channel message" for channel sessions.Related Issue
Fixes #95645
Type of Change
Changes Made
src/auto-reply/reply/groups.ts: AddedchatTypeLabel,destinationLabel,participantLabel,sameDestinationLabel, andtaskLabelvariables derived fromChatType. All group-chat-specific wording in the prompt now uses these labels, soChatType: "channel"renders "channel" throughout. Also madebuildGroupIntroChatType-aware so the activation line uses "channel message" for channel sessions.src/auto-reply/reply/groups.test.ts: Added comprehensive test verifying correct wording for bothChatType: "channel"andChatType: "group"across all prompt sections, includingmessage_tool_onlymode. Added test forbuildGroupIntrochannel/group wording.How to Test
node scripts/run-vitest.mjs run src/auto-reply/reply/groups.test.ts— all 8 tests passgrep -n 'chatTypeLabel\|destinationLabel\|participantLabel' src/auto-reply/reply/groups.ts— confirms label variables at lines 242–246Real behavior proof
buildGroupChatContextprompt unconditionally used "group chat" wording for all non-DM conversations, including public channels whereChatTypeis"channel". ThebuildGroupIntroactivation line unconditionally used "every group message" for always-on activation. This affected the intro line, destination references, participant labels, task labels, visible-response guidance, and first-turn activation intro throughout the entire prompt.fix/mattermost-channel-intro-wording(commita69e7ac2)node scripts/run-vitest.mjs run src/auto-reply/reply/groups.test.ts— 8/8 pass. (2) CalledbuildGroupChatContextandbuildGroupIntrofrom production source for channel and group modes.buildGroupIntroactivation line correctly uses "channel message" for channel sessions and "group message" for group sessions. 8/8 vitest assertions pass covering all wording variants.