Skip to content

refactor(slack): reuse canonical interactive block renderer - #128760

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup3-slack-canonical-renderer-20260824
Aug 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup3-slack-canonical-renderer-20260824

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Slack maintained two complete implementations for rendering the same text, button, and select controls. That duplication made action authorization, Slack limits, callback identities, and ordered delivery harder to keep consistent as interactive presentation evolved.

Why This Change Was Made

The shipped deprecated buildSlackInteractiveBlocks compatibility function keeps its exact public name, signature, export, and behavior, but now adapts legacy values through the existing SDK bridge and delegates to Slack's canonical presentation renderer. This removes 109 production lines without changing any public SDK, configuration, authorization, or transport contract. The assertion-safety inventory is reduced by exactly one because the deleted implementation contained an obsolete unsafe cast.

User Impact

Slack messages, approval prompts, question choices, callbacks, URLs, block ordering, control offsets, and platform size limits behave exactly as before. Existing integrations calling the deprecated public helper continue working unchanged.

Evidence

  • New table-driven compatibility coverage for typed approvals, callbacks, questions, and nonzero control offsets passed against the untouched previous implementation before the refactor: 32 Slack renderer tests passed.
  • Focused post-refactor proof passed 333 tests across 11 Slack suites, including the real outbound adapter, mocked Slack Web API delivery, reply assembly, approval/question envelopes, action dispatch, and interaction handling.
  • Exact assertion-safety ratchet passed across 4,274 files and 13,445 grandfathered assertions; the affected owner's baseline decreases from 2 to 1.
  • Targeted formatter, whitespace check, and changed-lane classification passed.
  • Two independent owner-boundary source reviews and the mandatory fresh Codex review found no actionable issues.
  • Production: +5/-114, net -109 lines. Tests: +46/-0. Inventory: +1/-1.
  • Full local changed-gate execution is unavailable because the shared canonical dependency tree contains pre-existing unrelated stale mixed-tree type errors; exact-head hosted CI and mandatory repository-native Testbox preparation provide the authoritative clean-environment gate.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 24, 2026
@steipete
steipete marked this pull request as ready for review August 24, 2026 14:29
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 10:35 AM ET / 14:35 UTC.

ClawSweeper review

What this changes

The PR replaces Slack’s deprecated legacy interactive-block rendering loop with the existing canonical presentation renderer after converting the legacy reply shape.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking source finding: the legacy Slack entry point now feeds an identity-preserving bridge into the already-canonical renderer. This maintainer-authored, maintainer-labeled PR should remain open for normal exact-head CI and explicit maintainer handling.

Priority: P3
Reviewed head: 6f018aef9bd089337d57668473a48df64509caa6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with source-backed legacy compatibility coverage and no actionable correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This repository-member PR is exempt from the external-contributor proof gate; its body reports focused Slack renderer validation, while exact-head CI remains the merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This repository-member PR is exempt from the external-contributor proof gate; its body reports focused Slack renderer validation, while exact-head CI remains the merge gate.
Evidence reviewed 6 items Legacy-to-canonical mapping: The legacy type admits only text, buttons, and select blocks; the SDK bridge maps each directly into the corresponding presentation block without rewriting its controls or values.
Changed renderer boundary: The deprecated public helper preserves its signature and delegates the converted legacy payload to the existing Slack presentation renderer, retaining the Slack-specific limit and action-ID logic in one owner.
Caller and dispatch path: Reply assembly calculates existing control offsets before calling the legacy helper, then appends its rendered rows beside presentation output; the refactor does not alter downstream delivery or interaction dispatch.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/slack/src/shared-interactive.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/slack/src/shared-interactive.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128760-8mSQ6L/target$ node scripts/run-vitest.mjs extensions/slack/src/shared-interactive.test.ts
node scripts/run-vitest.mjs extensions/slack/src/shared-interactive.test.ts
[test] starting test/vitest/vitest.extension-slack.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128760-8mSQ6L/target

 ✓  extension-slack  extensions/slack/src/shared-interactive.test.ts (32 tests) 22ms

 Test Files  1 passed (1)
      Tests  32 passed (32)
   Start at  14:36:34
   Duration  9.12s (transform 7.01s, setup 67ms, import 8.67s, tests 22ms, environment 0ms)

[test] passed 1 Vitest shard in 15.21s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128760-8mSQ6L/target$ node scripts/run-vitest.mjs extensions/slack/src/shared-interactive.test.ts



































Assertions:

  • PASS expect_output: shared-interactive.test.ts

How this fits together

Slack reply assembly combines existing Slack blocks, portable presentation blocks, and legacy interactive replies into ordered Block Kit messages. Returned Slack interaction identifiers then select the appropriate approval, callback, question, or reply dispatch path.

flowchart LR
  A[Legacy interactive reply] --> B[SDK compatibility bridge]
  B --> C[Canonical presentation renderer]
  C --> D[Slack Block Kit message]
  D --> E[Slack interaction payload]
  E --> F[Typed action dispatch]
Loading

Decision needed

Question Recommendation
After exact-head CI completes, should a Slack-area maintainer accept this behavior-preserving consolidation of the shipped deprecated helper? Accept after exact-head CI: Merge if the remaining required checks are green, preserving the single canonical renderer and the legacy compatibility entry point.

Why: The item carries the protected maintainer label and is authored by a repository member, so this workflow must leave the final merge decision to an explicit maintainer judgment.

Before merge

None.

Agent review details

Security

None.

PR surface

Source -109, Tests +46, Other 0. Total -63 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 114 -109
Tests 1 46 0 +46
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 3 52 115 -63

Review metrics

Metric Value Why it matters
Production versus test delta production +5/-114 (net -109); tests +46/-0; assertion baseline -1 The refactor removes the duplicate production renderer while adding focused compatibility cases and shrinking the existing assertion inventory.

Technical review

Best possible solution:

Land one canonical Slack rendering path once the exact PR head has completed its required CI, while retaining the deprecated helper as the narrow legacy-to-presentation adapter.

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

Not applicable: this PR refactors an existing renderer rather than reporting a failing user flow; source inspection establishes the intended legacy-to-canonical mapping.

Is this the best way to solve the issue?

Yes: converting the three legacy block variants through the existing SDK bridge and retaining Slack-specific rendering in the canonical owner removes duplicate policy without adding a parallel compatibility path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small behavior-preserving Slack maintenance refactor with no reported user regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This repository-member PR is exempt from the external-contributor proof gate; its body reports focused Slack renderer validation, while exact-head CI remains the merge gate.

Label justifications:

  • P3: This is a small behavior-preserving Slack maintenance refactor with no reported user regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This repository-member PR is exempt from the external-contributor proof gate; its body reports focused Slack renderer validation, while exact-head CI remains the merge gate.

Evidence

What I checked:

  • Legacy-to-canonical mapping: The legacy type admits only text, buttons, and select blocks; the SDK bridge maps each directly into the corresponding presentation block without rewriting its controls or values. (src/interactive/payload.ts:1008, b8d6e799a31d)
  • Changed renderer boundary: The deprecated public helper preserves its signature and delegates the converted legacy payload to the existing Slack presentation renderer, retaining the Slack-specific limit and action-ID logic in one owner. (extensions/slack/src/blocks-render.ts:247, 6f018aef9bd0)
  • Caller and dispatch path: Reply assembly calculates existing control offsets before calling the legacy helper, then appends its rendered rows beside presentation output; the refactor does not alter downstream delivery or interaction dispatch. (extensions/slack/src/reply-blocks.ts:461, 6f018aef9bd0)
  • Compatibility coverage: The focused Slack test suite covers legacy ordering, Slack limits, offsets, legacy payloads, and newly table-driven typed approval, callback, and question action IDs through the deprecated helper. (extensions/slack/src/shared-interactive.test.ts:343, 6f018aef9bd0)
  • Current-main provenance: Current-main blame attributes the legacy renderer body to the recent Slack-area commit by steipete; the submitted commit is a follow-up refactor of that same surface. (extensions/slack/src/blocks-render.ts:247, 234df15a6d7f)
  • Dependency boundary: The changed import is OpenClaw’s internal interactive-runtime SDK barrel, not the separate Codex harness/runtime; no affirmative Codex protocol or runtime dependency signal is present. (src/plugin-sdk/interactive-runtime.ts:45, b8d6e799a31d)

Likely related people:

  • steipete: Current-main blame for the legacy renderer body points to a recent commit by steipete, who also authored this focused consolidation. (role: recent Slack renderer contributor; confidence: high; commits: 234df15a6d7f, 6f018aef9bd0; files: extensions/slack/src/blocks-render.ts, extensions/slack/src/shared-interactive.test.ts)

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.

@steipete
steipete merged commit ec09147 into main Aug 24, 2026
232 checks passed
@steipete
steipete deleted the codex/cleanup3-slack-canonical-renderer-20260824 branch August 24, 2026 14:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant