Repository navigation
fix(auto-reply): use a chat_type-neutral group/channel intro opener - #96069
iloveleon19 wants to merge 1 commit into
Conversation
07e6333 to
30ae5af
Compare
|
Codex review: needs real behavior proof before merge. Reviewed June 23, 2026, 5:48 PM ET / 21:48 UTC. Summary PR surface: Source +6, Tests +16. Total +22 across 5 files. Reproducibility: yes. source-level reproduction is high confidence: a Mattermost public channel maps to Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the neutral opener change, regenerate the Codex prompt snapshots from the repository generator, and add redacted real-behavior proof for a Mattermost public-channel turn before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-level reproduction is high confidence: a Mattermost public channel maps to Is this the best way to solve the issue? Yes, the neutral shared-chat opener is the best narrow fix for issue #95645 because it removes the type collision without changing the separate Mattermost target-inference work tracked in #95646; the branch still needs generated snapshot repair and real proof before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a8f387ba199c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6, Tests +16. Total +22 across 5 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
buildGroupChatContext runs for both `group` and `channel` ChatTypes (see get-reply-run's isGroupChat), but its opener hard-coded "You are in a <provider> group chat." For a public channel the authoritative inbound chat_type is "channel", while "group" denotes a private channel / group DM, so the prose contradicts the trusted metadata. Agents key off the louder "group chat" wording and emit chat_type=group for a public channel, which addresses a non-existent group:<id> session and misroutes or loses replies. Reword the opener to "You are in a shared <provider> chat (not a 1:1 DM)." so it no longer declares a chat_type. Delivery/role guidance keeps its colloquial "group" wording, which is advice, not a type claim. The phrasing is provider-agnostic: it holds for every non-DM provider this intro fires for. Updates the affected unit/case/snapshot expectations and adds a public-channel regression test. Resolves openclaw#95645. Leaves the deeper chat_type derivation work to openclaw#95646. Co-Authored-By: Claude Opus 4.8 <[email protected]>
30ae5af to
9e03125
Compare
|
Superseded by #96244, which landed the same neutral-opener change and closed #95645. The fix is already in |
What Problem This Solves
Resolves #95645.
buildGroupChatContextis built for bothgroupandchannelChatTypes (the caller gates onisGroupChat = ChatType === "group" || ChatType === "channel"inget-reply-run), but its opener hard-coded:For a public channel the authoritative inbound-meta block reports
chat_type: "channel", while"group"denotes a private channel / group DM. So the natural-language opener contradicts the trusted metadata, and "group chat" is the more salient signal. Agents key off it and emitchat_type: group(or--chat-type groupto tools) for a public channel.Because session keys are namespaced
…:mattermost:<direct|channel|group>:<peerId>:thread:<root>, a wronggroupfor a public channel addresses a non-existent session and breaks downstream routing.Fix
Reword the opener so it no longer declares a
chat_type:This is the neutral wording proposed in the issue. It is provider-agnostic —
buildGroupChatContextis shared by all providers, and "shared chat (not a 1:1 DM)" holds for every non-DM conversation this intro fires for. The remaining"group"mentions in the function ("be a good group participant", "…sent to this group chat") are colloquial role/delivery guidance, not a type declaration, so they are intentionally left unchanged.Scope
Deliberately narrow: this is the system-prompt-intro half only. The deeper
chat_type-derivation inconsistency for private channels (channel-type vs target-string inference) is tracked separately in #95646 and is not addressed here.What changed
src/auto-reply/reply/groups.ts— neutral opener + rationale comment.src/auto-reply/reply/groups.test.ts— updated expectation; new regression test asserting a public-channel (ChatType: "channel") context opens neutrally and never says "… group chat".src/auto-reply/reply.triggers.group-intro-prompts.cases.ts— updated the Discord/WhatsApp/Telegram opener expectations (delivery-guidance text unchanged).src/agents/prompt-composition.test.ts— updated the Slack group opener invariant.test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md— regenerated viapnpm prompt:snapshots:gen(the opener change shifts the recorded char/token counts).Evidence (after-fix, on a live deployment)
The one-line opener reword is running in production (applied over the deployed
dist/get-reply-*.js).1. Deployed opener — verbatim from the running container. The agent declines to quote its system prompt verbatim, so the rendered template is shown directly from
dist(${providerLabel}is substituted at runtime, e.g.Mattermost); the old type-declaring opener is gone:2. Public channel →
chat_type: channel. The agent reads the trustedchat_typeaschanneland frames the venue as a shared chat that is not a 1:1 DM — no "group chat" type-word:3. Private channel →
chat_type: group. Same neutral opener; the agent reads the trustedchat_typeasgroup. Confirms the opener no longer forces "group" wording and the type comes from trusted metadata:Before the fix the opener read
You are in a <provider> group chat.for both of the above — which (per #95645) led agents to emitchat_type: groupfor a public channel, binding a non-existentgroup:<channelId>session and breaking threaded delivery.CI: the Codex prompt snapshot was regenerated;
prompt:snapshots:checkand the auto-reply / prompt-composition tests pass on the current head.