Fail closed when Slack mention detection is unavailable#91584
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 9:32 PM ET / 01:32 UTC. Summary PR surface: Source +1108, Tests +2536, Docs +23, Other +4. Total +3671 across 66 files. Reproducibility: yes. from source inspection: current main can leave botUserId unavailable or untrustworthy while the shared mention decision only skips required-mention traffic when mention detection is available. I did not run a live Slack workspace reproduction in this read-only review. Review metrics: 3 noteworthy metrics.
Stored data model 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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the Slack owner-boundary fix after redacted real Slack proof and explicit maintainer acceptance of the fail-closed upgrade behavior; if that behavior is too disruptive, rework toward an operator-visible warning, doctor repair, or opt-in strict mode. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main can leave botUserId unavailable or untrustworthy while the shared mention decision only skips required-mention traffic when mention detection is available. I did not run a live Slack workspace reproduction in this read-only review. Is this the best way to solve the issue? Yes for the code shape: the fix belongs in the Slack adapter admission boundary and preserves trusted app_mention, configured-pattern, and authorized-command paths. The remaining question is upgrade acceptance and real Slack proof, not a line-level correctness defect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1b8d83767445. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1108, Tests +2536, Docs +23, Other +4. Total +3671 across 66 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
Review history (3 earlier review cycles)
|
0fecc9b to
5321b35
Compare
|
Land-ready verification for
Known proof gaps: none. |
|
Merged via squash.
|
* fix(slack): fail closed when mention detection is unavailable * fix(slack): coordinate app mention retry history * fix(slack): reject user-token mention identity * fix(slack): reject user-token mention identity --------- Co-authored-by: OpenClaw Agent <openclaw-agent@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(slack): fail closed when mention detection is unavailable * fix(slack): coordinate app mention retry history * fix(slack): reject user-token mention identity * fix(slack): reject user-token mention identity --------- Co-authored-by: OpenClaw Agent <openclaw-agent@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com> (cherry picked from commit fe82346)
What Problem This Solves
Slack channels with
requireMention: truecould accept ordinary messages when startup could not establish a trustworthy bot identity. A failedauth.testleft mention detection unavailable, while a successful user-tokenauth.testcould incorrectly treat the human token owner as the bot mention target.Why This Change Was Made
The Slack adapter now fails closed only at its own admission boundary after sender, bot-message, and command authorization. It accepts trusted
app_mentionevents, configured mention patterns, and authorized control commands. Bot mention identity is populated only when Slack returns the documented bot-tokenbot_idshape.The implementation also coordinates Slack's duplicate
messageandapp_mentiondelivery paths. A trusted retry removes only the matching routed pending-history entry, and the history writer rechecks the race guard at the actual mutation boundary so late async sender/media resolution cannot reinsert stale context.User Impact
Evidence
auth.testcontract inspected: bot-token responses include bothuser_idandbot_id; invalid authentication returns an error.pnpm openclaw channels status --channel slack --probe --jsonreturnedprobe.ok: true, HTTP 200, and bot/team identity in 150 ms; no token was printed.invalid_auth.tbx_01kwqwq41acy7s12nh7kjcxstj: 4 files, 126 tests passed.tbx_01kwqwx5hzpczf12srwrjfh801: extension production/test typechecks, lint, dependency/architecture guards, and import-cycle checks passed.