fix(slack): preserve mention source metadata#75356
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Source inspection on current main shows Slack can collapse explicit/implicit mention facts into only WasMentioned/was_mentioned, and the PR body provides a live Slack before/after repro for the implicit-thread path. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the additive Slack mention metadata fix with the current stripped conversation-info path, after adding current-head live Slack proof and correcting the landing metadata to close #79025 only. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows Slack can collapse explicit/implicit mention facts into only WasMentioned/was_mentioned, and the PR body provides a live Slack before/after repro for the implicit-thread path. Is this the best way to solve the issue? Yes for the code direction. Carrying additive Slack mention target/source metadata through prepare and the existing stripped Conversation info block is the narrow maintainable fix without changing Slack activation policy. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e384932497f9. |
a8db8db to
21c619b
Compare
21c619b to
d6ac408
Compare
d49e7bb to
88829bd
Compare
88829bd to
a7a58f8
Compare
dcb36f5 to
a59a347
Compare
|
Thanks for taking this on. Directionally the fix looks correct, but not ready to merge yet. Please make the following changes:
|
Surface Slack mention metadata (source, was_mentioned, explicitly_mentioned_bot, mentioned_user_ids, mentioned_subteam_ids, implicit_mention_kinds) through the inbound prepare pipeline and into the conversation-info metadata payload so the LLM can reason about whether the bot was directly addressed or only joined an implicit thread. Closes openclaw#75203.
d8ae0c2 to
73a2306
Compare
…ions # Conflicts: # extensions/slack/src/monitor/message-handler/prepare.ts
|
@bek91 — thanks for the review. Both asks addressed; force-pushed to 1. Removed If we want a selective-reply nudge for 2. Unrelated changes The
5 files, +294/-17. Merge / verification While narrowing the branch I also re-merged Local proof:
|
|
Landed a corrected maintainer version in 7b781a8. What changed from the PR branch:
Slack dependency/code-path check:
Validation:
Note: broad Thanks @tmimmanuel. |


Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
#social, PR head83008331ff8eac444277251d8ceea566d804237b./home/ubuntu/codes/tmimmanuel/openclaw-pr-75356on PR head83008331ff8eac444277251d8ceea566d804237b.#socialSlack thread where OpenClaw had already participated.@dev), not the bot.maincommit3a0b81af9d7d86807be030415e2d1b1b38dae949.{ "is_group_chat": true, "was_mentioned": true, "explicitly_mentioned_bot": false, "mentioned_user_ids": ["U_DEV_REDACTED"], "implicit_mention_kinds": ["bot_thread_participant"], "mention_source": "implicit_thread" }@devwas the explicit Slack mention, not OpenClaw.maincommit3a0b81af9d7d86807be030415e2d1b1b38dae949, the same Slack thread path woke OpenClaw but only exposed the collapsed mention state:{ "is_group_chat": true, "was_mentioned": true }The prompt did not expose
explicitly_mentioned_bot,mentioned_user_ids,implicit_mention_kinds, ormention_source, so the agent could not reliably tell that the visible Slack mention was aimed at another user.Root Cause (if applicable)
Regression Test Plan (if applicable)
extensions/slack/src/monitor/message-handler/prepare.test.ts,src/auto-reply/reply/inbound-meta.test.tsUser-visible / Behavior Changes
Slack agents receive more precise inbound metadata for group/thread mention decisions. No config or default behavior changes.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
openrouter/owl-alphafor live Slack repro#socialchannel threadchannels.slack.mode="socket",channels.slack.groupPolicy="open",channels.slack.requireMention=false,channels.slack.replyToMode="all",channels.slack.thread.requireExplicitMention=false; visible group replies temporarily set to automatic for screenshot/log proof.Steps
main, start the gateway with Slack enabled.pnpm test extensions/slack/src/monitor/message-handler/prepare.test.ts src/auto-reply/reply/inbound-meta.test.ts -- --reporter=verbosepnpm tsgo:corepnpm tsgo:extensionspnpm exec oxfmt --check --threads=1 extensions/slack/src/monitor/message-handler/prepare.ts src/auto-reply/reply/inbound-meta.ts src/auto-reply/templating.ts extensions/slack/src/monitor/message-handler/prepare.test.ts src/auto-reply/reply/inbound-meta.test.tsgit diff --checkExpected
was_mentioned: truewithout the native Slack mention target/source fields.explicitly_mentioned_bot,mentioned_user_ids,implicit_mention_kinds, andmention_sourcefor the same behavior path.Actual
was_mentioned: truefor the affected implicit-thread path.explicitly_mentioned_bot: false,mentioned_user_ids: ["U_DEV_REDACTED"],implicit_mention_kinds: ["bot_thread_participant"], andmention_source: "implicit_thread"were present.pnpm tsgo:corepassed.pnpm tsgo:extensionspassed.git diff --checkpassed.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
Risks and Mitigations