Repository navigation
fix(channels): word group-chat intro by authoritative ChatType (#95645) - #95668
hansraj316 wants to merge 1 commit into
Conversation
…law#95645) A 'channel' ChatType was declared a 'group chat' in the system-prompt intro, contradicting the trusted chat_type:channel meta and nudging agents to emit 'group' for public/private channels. Declare the venue by the actual ChatType instead.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c50f02467c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const venueNoun = chatType === "channel" ? "channel" : "group chat"; | ||
| lines.push(`You are in a ${providerLabel} ${venueNoun}.`); |
There was a problem hiding this comment.
Apply channel wording to the full prompt
When ChatType is channel, get-reply-run.ts routes the turn through buildGroupChatContext, so this hunk only changes the first sentence while the same generated prompt still immediately says replies are sent to “this group chat” and “this same group” on lines 257/261. For Mattermost public/private channels, that leaves model-facing guidance that still conflicts with the authoritative chat_type: channel metadata and can continue nudging agents to address the non-existent group session this fix is meant to prevent.
Useful? React with 👍 / 👎.
|
Thanks for the context here. I did a careful shell check against current Close: current main already implements this PR's central Mattermost channel prompt fix through the merged canonical PR, with source and tests showing Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the merged current-main implementation from #96244 as the canonical fix; handle broader residual channel-wording choices in the separate open follow-up PRs if maintainers want them. Do we have a high-confidence way to reproduce the issue? No, current main no longer reproduces the central issue: source inspection shows Is this the best way to solve the issue? Yes, closing this PR is the best cleanup path because the merged current-main implementation is same-or-better and this branch is now conflicting and obsolete. Broader full-prompt wording choices are separate maintainer decisions in other open PRs. Security review: Security review cleared: The reviewed branch only changes prompt text and tests, and the cleanup decision does not add any dependency, workflow, secret, package, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 68ddb9744f78; fix evidence: commit 9e3a917d9ee0, main fix timestamp 2026-06-24T12:27:04+08:00. |
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
Fixes #95645. For any non-DM Mattermost conversation — including a public channel — the system-prompt intro declared "You are in a
<provider>group chat.", while the trusted inbound-meta block reportedchat_type: "channel". The two contradicted each other, and the salient "group chat" prose nudged agents to emitchat_type: group(or--chat-type group) for channels. Because session keys are namespaced by chat type, a wronggroupaddresses a non-existent session and breaks downstream routing.Why This Change Was Made
"group" is overloaded: it is both a specific
chat_typeenum value and a loose adjective in the prose. The declarative intro line is the one place that should match the authoritativeChatType, so it now words the venue byChatType(channel→ "channel";groupstays "group chat"). The remaining colloquial "group" delivery mentions are left as-is — they describe role/delivery, not the chat type.User Impact
Agents in Mattermost public/private channels no longer receive a system-prompt line that contradicts the trusted
chat_type, so they stop mislabeling channels asgroupand mis-addressing sessions. No config or API change.Evidence
src/auto-reply/reply/groups.ts: intro line now derived fromChatType.src/auto-reply/reply/groups.test.tsasserts achannelChatType yields "You are in a Mattermost channel." and agroupChatType still yields "group chat".pnpm test src/auto-reply/reply/groups.test.ts✅ (7 passed);src/agents/prompt-composition.test.ts✅ (Slackgroupwording unchanged).