Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c816ff50e
ℹ️ 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".
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 9:29 PM ET / 01:29 UTC. Summary PR surface: Source +42, Tests +38. Total +80 across 5 files. Reproducibility: yes. Source inspection shows Mattermost public channels map to Review metrics: 1 noteworthy metric.
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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical ChatType-aware shared-chat prompt helper that preserves true group wording for group chats and channel wording for trusted channel contexts, then close the overlapping sibling PRs against that landed path. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows Mattermost public channels map to Is this the best way to solve the issue? Yes, with a maintainer-selection caveat. Deriving all shared prompt labels from trusted AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1241885db6ad. Label changesLabel justifications:
Evidence reviewedPR surface: Source +42, Tests +38. Total +80 across 5 files. View PR surface stats
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
|
|
@clawsweeper re-review Pushed 21418a1615 with the channel wording carried through the shared prompt helper and first-turn intro. I also updated the PR body with the focused validation and direct prompt-output probe. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
21418a1 to
d93714f
Compare
|
@clawsweeper re-review Rebased on current main and force-pushed d93714f46e. The PR body now has the rerun validation and current prompt-output probe for the full channel wording fix. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
06bd3a1 to
431d38d
Compare
|
@clawsweeper re-review Rebased onto current main and force-pushed head 431d38d. I also resolved the outdated Codex review thread after verifying the current channel prompt carries channel wording through the shared prompt helper and first-turn intro. Validation:
The PR body evidence section is updated with this refresh. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Thanks for tightening the remaining shared-chat wording and for refreshing the proof. The reported #95645 contradiction was fixed by #96244 in I rechecked current Closing as broader follow-up work not planned, not as an exact duplicate or an assertion that every changed string already landed. Thanks @samrusani for the careful branch refresh and regression work. |
Closes #95645
What Problem This Solves
Fixes an issue where users in a Mattermost public channel would get prompt guidance that called the conversation a group chat even though OpenClaw's trusted metadata identifies it as
chat_type: "channel".Why This Change Was Made
The shared group/channel prompt context now derives its destination, participant, task, visible-response, and activation wording from the normalized
ChatType, so channel contexts consistently say channel while actual group chats keep the existing group-chat wording. The deeper Mattermost target-inference/session-routing work from #95646 is intentionally left out of scope.User Impact
Agents in Mattermost public channels get a consistent channel signal across the system prompt, reducing the chance that they choose
groupwhen a tool or response path needs the current chat type.Evidence
Direct local production-helper probe:
node --import tsx --input-type=module -e 'const { buildGroupChatContext, buildGroupIntro } = await import("./src/auto-reply/reply/groups.ts"); const sessionCtx = { ChatType: "channel", Provider: "mattermost" }; const combined = [buildGroupChatContext({ sessionCtx }), buildGroupChatContext({ sessionCtx, sourceReplyDeliveryMode: "message_tool_only" }), buildGroupIntro({ cfg: {}, sessionCtx, defaultActivation: "always", silentToken: "NO_REPLY" })].join("\n"); console.log(combined); for (const fragment of ["Mattermost group chat", "this group chat", "same group", "group participant", "group response", "group message"]) console.log(`${fragment}=${combined.includes(fragment)}`);'Key output:
Rebased onto current
origin/mainat3811001d27and force-pushed head431d38d9a0.Resolved the outdated Codex review thread after verifying the current channel prompt no longer contains the reported group wording.
node scripts/run-vitest.mjs src/auto-reply/reply/groups.test.ts src/auto-reply/reply.triggers.group-intro-prompts.test.ts- 2 Vitest shards passed, 13 tests passed.CI=true pnpm prompt:snapshots:gen- wrote 7 prompt snapshot files during conflict resolution.CI=true pnpm prompt:snapshots:check- prompt snapshots are current, 7 files../node_modules/.bin/oxfmt --check --threads=1 src/auto-reply/reply/groups.ts src/auto-reply/reply/groups.test.ts src/auto-reply/reply.triggers.group-intro-prompts.test.ts src/auto-reply/reply.triggers.group-intro-prompts.cases.ts- passed.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src/auto-reply/reply/groups.ts src/auto-reply/reply/groups.test.ts src/auto-reply/reply.triggers.group-intro-prompts.test.ts src/auto-reply/reply.triggers.group-intro-prompts.cases.ts- passed.git diff --check- passed.Not tested: live Mattermost server. The issue was source-reproduced, and the generated prompt output was verified locally after the patch.