fix(slack): ensure distinct sessions for public channels in replyToMode="all"#75995
fix(slack): ensure distinct sessions for public channels in replyToMode="all"#75995dchekmarev wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection. On current main, two top-level public Slack room messages with Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow Slack routing fix after the contributor adds redacted real Slack/runtime proof and the targeted Slack routing tests pass. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection. On current main, two top-level public Slack room messages with Is this the best way to solve the issue? Yes, subject to real behavior proof. The PR is the narrowest maintainable direction I found: let public rooms use Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e53ec522c27f. Re-review progress:
|
e770ce2 to
39e7e3e
Compare
39e7e3e to
a7fe4c9
Compare
|
@steipete I’m submitting this draft as a TDD-based proof of a Slack routing bug. The Problem: What this PR does:
This PR contains tests only. My goal is to align on this routing contract before I implement the narrow fix in prepare-routing.ts. P.S. I have also updated prepare.thread-session-key.test.ts to align with this new contract. Since that test previously asserted shared sessions for replyToMode="all", it was effectively codifying the bug I'm now addressing. Looking forward to your feedback! |
82e92a0 to
1103141
Compare
99b699b to
80fca27
Compare
62c9a59 to
224a248
Compare
|
Hey @steipete since you've been active on Slack-related updates recently, I've updated this PR with the production fix. All matrix tests are now passing. Ready for review. |
ef1315c to
e4faa12
Compare
9ccb69d to
9be5775
Compare
0caf972 to
b9fdada
Compare
b9fdada to
7bd98f5
Compare
7bd98f5 to
fbe53f7
Compare
Summary
replyToMode="all", forcing multiple top-level messages into a single shared session.canonicalThreadIdlogic to allowautoThreadIdfor public rooms whenreplyToMode="all"is active.prepare.thread-session-key.test.tsto align with the fixed routing contract.Change Type
Scope
Root Cause
The
resolveSlackRoutingContexthad a strict guard that forcedroomThreadId(shared session) for allisRoomishchannels. This blockedautoThreadIdfrom being used for top-level messages even when the user explicitly requested distinct threads viareplyToMode="all".Regression Test Plan
extensions/slack/src/monitor/message-handler/prepare-routing.race-condition.test.tsallmode yield distinct sessions, while Group DMs, DMs, and other modes (off,first,batched) maintain their original shared-session behavior to prevent "thread explosion."Routing State Matrix (Verified)
all:thread:<ts>)off/first/batchedall:thread:<ts>)Evidence
All 16 tests in
prepare-routing.race-condition.test.tsare passing on the latestmain.Verified that
rootmessage seeding correctly propagates to child replies (thread inheritance).Human Verification
replyToMode="off","first", and"batched"still result in shared sessions (zero regression for default users).Compatibility / Migration
all.