Skip to content

fix: enable Slack native approvals for Enterprise Grid installs - #120874

Merged
steipete merged 3 commits into
mainfrom
sjf/slack-grid-native-approvals
Aug 9, 2026
Merged

steipete merged 3 commits into
mainfrom
sjf/slack-grid-native-approvals

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Enterprise Grid operators could not use Slack-native exec approval buttons even though OpenClaw already carried the originating workspace through Enterprise routing. The original path disabled native approvals, and incomplete app setup could leave visible buttons with no callback delivery.

Why This Change Was Made

Slack now owns the complete Enterprise approval boundary: only exec approvals are enabled, and they require explicit team:<team-id>:user:<user-id> entries in channels.slack.execApprovals.approvers that match the request's originating team. Raw Slack IDs and commands.ownerAllowFrom are ignored for Enterprise accounts, and Enterprise plugin approvals remain unavailable because their approver identity is not workspace-qualified.

Enterprise button values are signed with HMAC-SHA256 using the resolved Slack account token and originating team, then verified before authorization or Gateway resolution. Unsigned or model-authored values, tampering, wrong credentials, and cross-team replay fail closed. Workspace installs keep the existing v1 behavior. Pending receipts and final updates retain team scope and use the listener-owned workspace client.

Every first-party complete Slack manifest and setup path now enables Interactivity. Socket Mode does not require a public Interactivity Request URL; HTTP mode uses the same public Slack endpoint as Event Subscriptions. The callback listener type also follows the installed @slack/[email protected] middleware contract: SlackActionMiddlewareArgs & AllMiddlewareArgs.

No generic core, protocol, or storage surface changed. The local post-review repair covered exactly 21 files: production +372/-23, tests +646/-59, docs +66/-22, generated +5/-5 (total +1089/-109). The production growth implements the workspace-qualified authorization invariant and credential-bound callback provenance; tests are counted separately.

User Impact

Enterprise Grid operators can configure and use Slack-native exec approvals without letting a workspace-local user ID authorize another workspace. Approval prompts, approver DMs, button callbacks, and final status updates stay with the originating team. Existing workspace-installed Slack apps keep exec and plugin approval behavior; Enterprise plugin approvals remain disabled.

Existing Slack apps must enable Interactivity before approval buttons can deliver callbacks. New operators get that setting in every documented manifest and setup path.

Evidence

  • Local focused proof:
    node scripts/run-vitest.mjs extensions/slack/src/approval-actions.test.ts extensions/slack/src/exec-approvals.test.ts extensions/slack/src/approval-native.test.ts extensions/slack/src/approval-handler.runtime.test.ts extensions/slack/src/monitor/events/interactions.test.ts extensions/slack/src/monitor/provider.allowlist.test.ts extensions/slack/src/send.update.test.ts extensions/slack/src/setup-surface.test.ts src/docs/channel-config-examples.test.ts
    Result: 9 files, 190 tests passed (4 core docs and 186 Slack).
  • Canonical oxfmt on all 21 touched files and git diff --check: clean.
  • Blacksmith Testbox static/boundary proof: provider blacksmith-testbox, lease tbx_01kzkwnh38vpfkp1yyr3mv78dy, slug quick-lobster-2a62. Bundled-channel metadata, production types, oxlint shards, format check, test/script/root types, and extension package boundary compile/canary succeeded, including all 125 extension compiles and 2 canaries.
  • Same Testbox focused proof: 9 files, 190 tests passed.
  • Authoritative pre-commit autoreview: clean, no accepted/actionable findings, confidence 0.92. TruffleHog: clean.
  • Repository-native review artifacts validated on exact head cf65bcd530e27b586214079e6290f3544fb0a7f2: READY FOR /prepare-pr, issueValidation.status=valid, zero findings.
  • An earlier broad changed-gate attempt on lease tbx_01kzkrz5kd09za077s5gg8yhk4 stopped before relevant lanes on unrelated moving-main max-lines ratchet entries. No baseline was edited; the exact relevant lanes above are green.
  • Known gap: no live Enterprise Grid click-through was run because real org-install credentials were unavailable. This is not claimed as live proof; deterministic owner-boundary, callback, setup-surface, and package-boundary coverage is green.

AI-assisted: yes

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@sjf-oa
sjf-oa marked this pull request as ready for review August 9, 2026 04:15
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 9, 2026, 2:49 AM ET / 06:49 UTC.

ClawSweeper review

What this changes

This PR enables Enterprise Grid Slack approvals by carrying the originating workspace through approval delivery, button callbacks, and final message updates.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: the runtime repair follows the existing Enterprise workspace boundary, but the prior P1 documentation blocker remains on the unchanged head. The Enterprise manifests still omit Slack interactivity, so configured approval buttons cannot send callbacks.

Priority: P1
Reviewed head: 97f2882104389085794ff46215c8818dcb06562d

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The runtime design is sound, but the unresolved setup documentation defect blocks a higher rating.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies this as a maintainer PR, so the external-contributor proof gate does not apply; the body nevertheless contains no observed Enterprise Grid callback run.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies this as a maintainer PR, so the external-contributor proof gate does not apply; the body nevertheless contains no observed Enterprise Grid callback run.
Evidence reviewed 6 items Current main blocks the reported workflow: Current main explicitly rejects Enterprise native approvals before monitor startup and returns before registering interactions.
PR runtime boundary is coherent: The branch carries a qualified workspace target into the pending receipt and uses the canonical update helper with that workspace scope; callback handling validates event scope before processing approval actions.
Enterprise setup documentation is incomplete: The changed availability claim says Enterprise approval buttons are supported, but both dedicated Enterprise manifests remain event-only and do not enable interactivity.
Findings 1 actionable finding [P1] Add interactivity to both Enterprise manifests
Security None None.

How this fits together

The Slack plugin receives Enterprise workspace events, creates workspace-qualified targets, and sends approval prompts through Slack. Button actions resolve the approval through Gateway and update the originating Slack message in that same workspace.

flowchart LR
A[Enterprise Slack event] --> B[Workspace-qualified target]
B --> C[Approval prompt]
C --> D[Slack approval button]
D --> E[Validated workspace callback]
E --> F[Gateway decision]
F --> G[Workspace-scoped message update]
Loading

Before merge

  • Add interactivity to both Enterprise manifests (P1) - The new text says Enterprise approval buttons are supported, but both Enterprise manifests still omit settings.interactivity. The same page says these buttons require interactivity, so administrators following either manifest will receive prompts without callback delivery; enable it for Socket Mode and add the HTTP request URL for HTTP mode.
  • Resolve merge risk (P1) - Merging as written tells Enterprise administrators that approval buttons work while both supplied Enterprise manifests omit Slack interactivity, causing button clicks not to reach OpenClaw.
  • Resolve merge risk (P1) - The exact head has failed extension-boundary, lint, and type checks; their causes need resolution before merge.

Findings

  • [P1] Add interactivity to both Enterprise manifests — docs/channels/slack.md:246-248
Agent review details

Security

None.

PR surface

Source +56, Tests +229, Docs +4. Total +289 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 8 111 55 +56
Tests 5 280 51 +229
Docs 2 14 10 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 405 116 +289

Review metrics

Metric Value Why it matters
Production versus tests production +111/-55, tests +280/-51 The runtime growth is tied to workspace-scoped Enterprise approvals; the missing manifest setup prevents that capability from working for documented installs.

Merge-risk options

Maintainer options:

  1. Complete Enterprise approval setup (recommended)
    Enable Slack interactivity in both Enterprise manifests and document the HTTP callback URL before merging the runtime support.

Technical review

Best possible solution:

Add approval-only interactivity to both Enterprise manifests, including the HTTP callback URL, then rerun the focused Slack checks on the updated head.

Do we have a high-confidence way to reproduce the issue?

Yes — current source proves Enterprise accounts are presently excluded, and the branch’s documented manifests lack the interactivity configuration required for the new callback path. No live Enterprise Grid run was supplied.

Is this the best way to solve the issue?

Yes, with the remaining documentation repair: preserving the workspace at the Slack target, receipt, and validated callback boundaries is the narrowest owner-aligned fix.

Full review comments:

  • [P1] Add interactivity to both Enterprise manifests — docs/channels/slack.md:246-248
    The new text says Enterprise approval buttons are supported, but both Enterprise manifests still omit settings.interactivity. The same page says these buttons require interactivity, so administrators following either manifest will receive prompts without callback delivery; enable it for Socket Mode and add the HTTP request URL for HTTP mode.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against dba99b355b4e.

Labels

Label changes:

  • add P1: The PR repairs a broken Slack approval workflow, but its documented Enterprise setup still prevents callbacks for affected users.
  • add merge-risk: 🚨 other: The new Enterprise setup claim can leave administrators with visible approval prompts whose button actions never reach the gateway.

Label justifications:

  • P1: The PR repairs a broken Slack approval workflow, but its documented Enterprise setup still prevents callbacks for affected users.
  • merge-risk: 🚨 other: The new Enterprise setup claim can leave administrators with visible approval prompts whose button actions never reach the gateway.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Repository state identifies this as a maintainer PR, so the external-contributor proof gate does not apply; the body nevertheless contains no observed Enterprise Grid callback run.

Evidence

What I checked:

Likely related people:

  • kevinlin-openai: Introduced the Enterprise Grid installation surface that owns the workspace-qualified behavior. (role: Enterprise Grid feature origin; confidence: high; commits: 245b91b83de0; files: extensions/slack/src/monitor/provider.ts, docs/channels/slack.md)
  • steipete: Recent approval-gate refactor owns the current Enterprise eligibility restriction and surrounding native-approval behavior. (role: recent approval-path contributor; confidence: high; commits: 73bdb4b924f6; files: extensions/slack/src/approval-native-gates.ts, extensions/slack/src/approval-handler.runtime.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add Slack interactivity and the HTTP callback URL to both Enterprise manifests.
  • Resolve the failed exact-head checks after updating the branch.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-09T04:51:29.590Z sha 97f2882 :: found issues before merge. :: [P1] Document Slack interactivity in both Enterprise manifests

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 9, 2026
@sjf-oa sjf-oa self-assigned this Aug 9, 2026
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Land-ready proof for exact head cf65bcd530e27b586214079e6290f3544fb0a7f2:

  • Focused command: node scripts/run-vitest.mjs extensions/slack/src/approval-actions.test.ts extensions/slack/src/exec-approvals.test.ts extensions/slack/src/approval-native.test.ts extensions/slack/src/approval-handler.runtime.test.ts extensions/slack/src/monitor/events/interactions.test.ts extensions/slack/src/monitor/provider.allowlist.test.ts extensions/slack/src/send.update.test.ts extensions/slack/src/setup-surface.test.ts src/docs/channel-config-examples.test.ts — 9 files, 190 tests passed (4 core docs and 186 Slack).
  • Canonical oxfmt on all 21 post-review files plus git diff --check — clean.
  • Blacksmith Testbox provider blacksmith-testbox, lease tbx_01kzkwnh38vpfkp1yyr3mv78dy, slug quick-lobster-2a62 — bundled-channel metadata, production types, oxlint shards, format, test/script/root types, extension package boundary compile and canary all succeeded, including 125 extension compiles and 2 canaries. The same Testbox ran the 9-file focused proof: 190 tests passed.
  • Authoritative pre-commit autoreview — autoreview clean: no accepted/actionable findings reported, confidence 0.92. TruffleHog clean.
  • Repository-native review artifacts — validated READY FOR /prepare-pr, issueValidation.status=valid, zero findings at this exact head.

The ClawSweeper findings are addressed: Interactivity is enabled in every first-party complete Slack manifest/setup path; the callback uses Bolt's full middleware type; Enterprise exec approvers must be explicit and team-qualified; Enterprise plugin/wildcard authorization remains disabled; unsigned/model-authored, tampered, wrong-key, and cross-team-replayed buttons are rejected before authorization or Gateway calls.

Known gap: no live Enterprise Grid click-through was run because real org-install credentials were unavailable. This is not claimed as live proof.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit 9679895 into main Aug 9, 2026
129 checks passed
@steipete
steipete deleted the sjf/slack-grid-native-approvals branch August 9, 2026 19:10
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
…claw#120874)

* fix(slack): scope Grid native approvals by team

* fix(slack): type action middleware context

* fix(slack): secure Grid native approvals

Co-authored-by: Sarah Fortune <[email protected]>

---------

Co-authored-by: Sarah Fortune <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants