feat(slack): support Enterprise Grid org installs#102372
Conversation
|
Codex review: needs changes before merge. Reviewed July 9, 2026, 2:28 AM ET / 06:28 UTC. Summary PR surface: Source +1149, Tests +1643, Docs +279, Generated 0. Total +3071 across 72 files. Reproducibility: not applicable. as a feature PR. Source inspection shows current main's single-workspace Slack guard, and the PR body includes redacted live org-install output for the new flow. Review metrics: 2 noteworthy metrics.
Stored data model 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
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Fix the lint blockers, then merge only if maintainers accept the documented opt-in Enterprise V1 scope and public hook contract. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR. Source inspection shows current main's single-workspace Slack guard, and the PR body includes redacted live org-install output for the new flow. Is this the best way to solve the issue? Mostly yes after the lint fix and maintainer approval. Using Bolt's listener-scoped WebClient while failing closed for detached paths is the clean V1 boundary for the stated Enterprise Grid problem. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6620aba25ad9. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1149, Tests +1643, Docs +279, Generated 0. Total +3071 across 72 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
Review history (3 earlier review cycles)
|
|
@clawsweeper re-review Live Enterprise Grid proof is now included in the PR body, and the public plugin hooks are documented and covered by focused SDK contract tests on head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
2194d77 to
392c410
Compare
|
@clawsweeper re-review Rebased onto current |
|
🦞🧹 I asked ClawSweeper to review this item again. |
* feat(slack): support Enterprise Grid org installs * docs: refresh generated docs map * fix(slack): satisfy enterprise routing CI * fix(slack): accept org auth without app id * docs(plugin-sdk): document channel policy hooks * fix(slack): reuse canonical sender for enterprise replies * test(slack): fix enterprise sender lint --------- Co-authored-by: Kevin Lin <[email protected]>
…xtends openclaw#95390) Slack channel and thread sessions rebuilt wake prompt context only from the in-memory channel-history window, which never contains the bot's own replies and is empty after a gateway restart. Merge a bounded window (limit 10) of the session's canonical transcript into the inbound history, deduped against the channel window by timestamp+text, mirroring the Telegram direct-chat fix from openclaw#95390 (openclaw#95378). Enterprise Grid org installs (openclaw#102372) qualify the room session key and the channel-history key with the event workspace; the transcript read consumes the handler's own routing-provided sessionKey/storePath, so it follows that scoping automatically. A Grid-shaped room-wake test covers the org-install path. Co-Authored-By: Claude Fable 5 <[email protected]>
…xtends openclaw#95390) Slack channel and thread sessions rebuilt wake prompt context only from the in-memory channel-history window, which never contains the bot's own replies and is empty after a gateway restart. Merge a bounded window (limit 10) of the session's canonical transcript into the inbound history, deduped against the channel window by timestamp+text, mirroring the Telegram direct-chat fix from openclaw#95390 (openclaw#95378). Enterprise Grid org installs (openclaw#102372) qualify the room session key and the channel-history key with the event workspace; the transcript read consumes the handler's own routing-provided sessionKey/storePath, so it follows that scoping automatically. A Grid-shaped room-wake test covers the org-install path. Co-Authored-By: Claude Fable 5 <[email protected]>
…xtends openclaw#95390) Slack channel and thread sessions rebuilt wake prompt context only from the in-memory channel-history window, which never contains the bot's own replies and is empty after a gateway restart. Merge a bounded window (limit 10) of the session's canonical transcript into the inbound history, deduped against the channel window by timestamp+text, mirroring the Telegram direct-chat fix from openclaw#95390 (openclaw#95378). Enterprise Grid org installs (openclaw#102372) qualify the room session key and the channel-history key with the event workspace; the transcript read consumes the handler's own routing-provided sessionKey/storePath, so it follows that scoping automatically. A Grid-shaped room-wake test covers the org-install path. Co-Authored-By: Claude Fable 5 <[email protected]>
…xtends openclaw#95390) Slack channel and thread sessions rebuilt wake prompt context only from the in-memory channel-history window, which never contains the bot's own replies and is empty after a gateway restart. Merge a bounded window (limit 10) of the session's canonical transcript into the inbound history, deduped against the channel window by timestamp+text, mirroring the Telegram direct-chat fix from openclaw#95390 (openclaw#95378). Enterprise Grid org installs (openclaw#102372) qualify the room session key and the channel-history key with the event workspace; the transcript read consumes the handler's own routing-provided sessionKey/storePath, so it follows that scoping automatically. A Grid-shaped room-wake test covers the org-install path. Co-Authored-By: Claude Fable 5 <[email protected]>
Closes #102371
What Problem This Solves
Slack Enterprise Grid org installations can deliver events for multiple granted workspaces through one bot token. OpenClaw previously compared every event with one startup workspace and used detached clients later, so valid events from other granted workspaces could be rejected or replied to without a durable workspace boundary.
Why This Change Was Made
This adds an explicit
enterpriseOrgInstallSlack account mode. Startup validates the org installation withauth.test; each directmessageorapp_mentionuses Bolt's validated enterprise, app, workspace, and listener-ownedWebClient; sessions, routes, transcripts, dedupe keys, and Slack caches are workspace-qualified.Immediate replies reuse the canonical
sendMessageSlackdelivery engine. The listener path must provide the validated event scope and the exact injected Bolt client; a naked client cannot bypass Enterprise admission. The client andteamIdare snapshotted before the in-memory send queue, queue/thread bookkeeping is workspace-qualified, and the listener client is never serialized or persisted.Enterprise V1 deliberately fails closed for relay delivery, proactive/deferred/queued delivery, runtime bindings, Slack action tools, and Slack-native approvals. Existing workspace installations keep their current startup, client, action, binding, and delivery behavior.
User Impact
Enterprise Grid operators can run one org-installed Slack app across every workspace Slack has granted to that installation, while keeping message authorization and runtime state isolated per workspace. Operators enable the mode explicitly and follow the documented Socket Mode or HTTP org-install workflow.
Evidence
WebClientautomatically injectsteam_id.sendMessageSlack: exact-client admission, client/scope mismatch rejection, strict target admission, cross-team queue independence, same-team serialization, mutation-resistant capability snapshots, team-qualified thread participation, chunks/receipts, missing-timestamp rejection, and media caption/upload behavior.ab49773e556passes 196 focused Slack tests, Slack package runtime build, repository QA runtime build, focused formatting/lint, docs MDX validation, and an independent security/isolation review with no remaining findings.tsgoremains blocked only by unchangedextensions/qa-labCrabline diagnostics outside this PR's changed paths; the Slack package runtime build succeeds.Live Enterprise Grid org-install proof (redacted, 2026-07-08 PDT, exact simplification head
ab49773e556):The request was sent by a human Slack user in a granted Enterprise Grid workspace. The local gateway received it through Socket Mode, preserved the event workspace context, and democlaw posted the exact response in the originating thread. No token, private endpoint, IP address, or internal Slack identifier is included above. This live proof exercised the canonical listener-scoped
sendMessageSlackpath on the exact current head.Manual verification: