Skip to content

fix(test): narrow Slack socket payload bytes - #150678

Merged
RomneyDa merged 1 commit into
mainfrom
fix/maturity-351676-slack-ci
Sep 17, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/maturity-351676-slack-ci

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • narrow Slack Socket Mode test payloads with Buffer.isBuffer
  • preserve Buffer arrays and ArrayBuffer handling without casts
  • restore the extension test-type gate on current main

Why

The WebSocket RawData union includes Buffer[], Buffer, and ArrayBuffer. The existing ternary left Buffer | ArrayBuffer at the Buffer.from call, so the extension test-type job failed on every unrelated PR.

Validation

  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/slack-ci-rebased.tsbuildinfo
  • pnpm test extensions/slack/src/monitor/provider.interop.test.ts (19/19)
  • pnpm check:changed
  • P0-P2 autoreview: no actionable findings

Supersedes the conflicting type-only alternatives #150646 and #150650. The shared Socket Mode acknowledgement fixture is already present on current main; this PR does not duplicate it.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review September 17, 2026 06:23
@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@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 Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 2:30 AM ET / 06:30 UTC.

ClawSweeper review

What this changes

The PR explicitly distinguishes Buffer payloads in Slack’s WebSocket test fixture so acknowledgement bytes can be decoded with correctly narrowed types.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, behavior-preserving test repair with no actionable findings. Neither related alternative has merged, and the member-authored PR is protected from cleanup closure.

Priority: P3
Reviewed head: 58652667e2956d3fe0946f0d6c32f63620534ba9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable test repair with relevant reported validation and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes only the test server’s acknowledgement decoder; the external-contributor proof gate does not apply, and no authority boundary changes. Reported typechecking and interop results support the repair without implying a live Slack run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes only the test server’s acknowledgement decoder; the external-contributor proof gate does not apply, and no authority boundary changes. Reported typechecking and interop results support the repair without implying a live Slack run.
Evidence reviewed 6 items Verified introduced change: The pinned base-to-head diff changes only payload narrowing. Buffer arrays still use concatenation, Buffers pass through, and ArrayBuffers use Buffer.from; assertions, lifecycle, and production code remain unchanged.
Existing test and production boundary: The complete interop test retains control/message acknowledgement ordering, following-message delivery, warning-count, and connection assertions. The production owner constructs the Slack receiver and installs its envelope guard; this PR does not modify that owner.
Published dependency type contracts: The target imports WebSocketServer from ws and pins @types/ws 8.18.1 and @types/node 26.5.0, establishing the relevant dependency contract. Published package metadata identifies DefinitelyTyped/DefinitelyTyped as their repository. Inspection found RawData = Buffer | ArrayBuffer | Buffer[] and Buffer.isBuffer(obj): obj is Buffer. Packages were read in memory without installation or execution. Command:.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Slack plugin uses Socket Mode to receive events and send acknowledgements. The changed test fixture decodes those acknowledgements from a local WebSocket server and checks their order and continued message handling.

flowchart LR
  A[Fixture event envelopes] --> B[Slack Socket Mode receiver]
  B --> C[WebSocket acknowledgements]
  C --> D[Normalize payload bytes]
  D --> E[Decode envelope identifiers]
  E --> F[Check order and continued delivery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 3 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 3 0

Review metrics

None.

Technical review

Best possible solution:

Keep the explicit payload narrowing within the existing acknowledgement fixture and preserve its behavioral assertions.

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

Yes, the focused verification path is the extension-test TypeScript project and this interop suite; source and published types identify the narrowing boundary. The compiler failure was not independently reproduced during this read-only review.

Is this the best way to solve the issue?

Yes. The explicit Buffer predicate handles the declared union without casts, duplicate fixtures, weaker assertions, or production changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c49879668263.

Labels

Label changes:

  • add P3: This bounded test-type repair preserves production behavior and existing assertions.
  • 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 MEMBER-authored PR changes only the test server’s acknowledgement decoder; the external-contributor proof gate does not apply, and no authority boundary changes. Reported typechecking and interop results support the repair without implying a live Slack run.

Label justifications:

  • P3: This bounded test-type repair preserves production behavior and existing assertions.
  • 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 MEMBER-authored PR changes only the test server’s acknowledgement decoder; the external-contributor proof gate does not apply, and no authority boundary changes. Reported typechecking and interop results support the repair without implying a live Slack run.

Evidence

What I checked:

  • Verified introduced change: The pinned base-to-head diff changes only payload narrowing. Buffer arrays still use concatenation, Buffers pass through, and ArrayBuffers use Buffer.from; assertions, lifecycle, and production code remain unchanged. (extensions/slack/src/monitor/provider.interop.test.ts:508, 58652667e295)
  • Existing test and production boundary: The complete interop test retains control/message acknowledgement ordering, following-message delivery, warning-count, and connection assertions. The production owner constructs the Slack receiver and installs its envelope guard; this PR does not modify that owner. (extensions/slack/src/monitor/provider-support.ts:334, 58652667e295)
  • Published dependency type contracts: The target imports WebSocketServer from ws and pins @types/ws 8.18.1 and @types/node 26.5.0, establishing the relevant dependency contract. Published package metadata identifies DefinitelyTyped/DefinitelyTyped as their repository. Inspection found RawData = Buffer | ArrayBuffer | Buffer[] and Buffer.isBuffer(obj): obj is Buffer. Packages were read in memory without installation or execution. Command:.
  • Feature history and routing: Current-main file history includes the envelope regression coverage and earlier Socket Mode lifecycle work. GitHub’s commit patch confirms the acknowledgement fixture was added with the envelope work. Local blame could not complete because a required historical object was unavailable; no blame-based introduction claim is made. (extensions/slack/src/monitor/provider.interop.test.ts:493, 179982f31fc6)
  • Necessity and related alternatives: Live metadata confirms this PR remains open and unmerged at the pinned head and base. The supplied discussion identifies fix(slack): narrow Socket Mode message buffers #150646 as closed unmerged and fix(slack): restore Socket Mode test validation #150650 as an overlapping open alternative; the latter remains unmerged on live inspection. Neither establishes a merged replacement. The fetched main retains the previous expression. Local release-tag inspection was unavailable, so no shipped-fix claim is made. (58652667e295)
  • Validation and read-only limits: The captured PR body reports extension-test typechecking, 19/19 interop tests, and changed-file checks passing. These were not rerun under the read-only review contract. The reviewer’s diff whitespace check passed and the checkout remained clean. (extensions/slack/src/monitor/provider.interop.test.ts:508, 58652667e295)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

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: XS 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