Skip to content

fix(slack): narrow websocket raw data before buffering - #150630

Closed
RomneyDa wants to merge 2 commits into
mainfrom
fix/slack-ws-rawdata-buffer-type
Closed

RomneyDa wants to merge 2 commits into
mainfrom
fix/slack-ws-rawdata-buffer-type

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Validation

  • pnpm exec vitest run extensions/slack/src/monitor/provider.interop.test.ts extensions/slack/src/monitor.failure-notices.test.ts extensions/slack/src/monitor.tool-result.test.ts extensions/slack/src/monitor/provider.auth-test-token.test.ts extensions/slack/src/monitor/provider.reconnect-loop.test.ts (98 passed)
  • pnpm tsgo:extensions:test
  • pnpm check:changed

@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.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 2:17 AM ET / 06:17 UTC (Revision 2).

ClawSweeper review

What this changes

The PR repairs Slack tests by narrowing incoming WebSocket data before buffering and adding acknowledgement methods to the shared Socket Mode fixture.

Merge readiness

⛔ Blocked before merge - 3 items remain

Both repairs already exist on current main through #149291; no unique remaining behavior was identified. Automatic closure is prohibited because this PR is MEMBER-authored and carries the protected maintainer label.

Priority: P3
Reviewed head: 9410d85f038516f366d8a30891b19af2e544996e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, technically sound test repair with reported targeted validation and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes test decoding and fixtures only; the external-contributor proof gate does not apply, and no authority boundary changes.
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 test decoding and fixtures only; the external-contributor proof gate does not apply, and no authority boundary changes.
Evidence reviewed 8 items Verified introduced patch: The pinned merge-base-to-head diff contains only RawData narrowing and two shared-fixture methods. Assertions, production behavior, dependencies, and configuration are unchanged.
Current-main implementation and history: Current main narrows ArrayBuffer before Buffer.from and supplies an EventEmitter-backed receiver fixture with an asynchronous sender. The inspected commit patch explicitly repairs both defects.
Merged repair verified on GitHub: GitHub confirms #149291 merged at 2026-09-17T06:10:02Z with the inspected main commit. Its body explicitly documents both Slack repairs, 120 passing selected tests, and passing extension test types.
Findings None None.
Security None None.

How this fits together

Slack’s Socket Mode receiver accepts WebSocket envelopes and acknowledges them before ordinary messages continue through Bolt. These changes affect the fixtures and loopback tests that validate that receive path.

flowchart LR
  A[Loopback WebSocket server] --> B[Slack Socket Mode receiver]
  B --> C[Envelope guard]
  C --> D[SDK acknowledgement]
  C --> E[Ordinary message dispatch]
  D --> F[Decode acknowledgement bytes]
  F --> G[Test assertions]
  E --> G
Loading

Decision needed

Question Recommendation
Should this protected PR be retired now that the merged main repair covers both changes? Retire the redundant branch: Close this PR manually with a link to the merged repair at #149291.

Why: The technical overlap is established, but MEMBER authorship and the maintainer label reserve closure for a maintainer.

Before merge

  • Resolve merge risk (P1) - The captured GitHub state reports merge conflicts; any retained branch would need reconciliation with main’s existing repair before merge.
  • Complete next step (P2) - A maintainer should decide whether to retire this redundant PR; retaining it requires a distinct remaining requirement and conflict resolution.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 7 1 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 7 1 +6

Review metrics

None.

Root-cause cluster

Relationship: superseded
Canonical: #149291
Summary: The merged main repair covers both test defects; the other Slack proposal also contains broader guard-construction work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain main’s working RawData conversion and EventEmitter-backed fixture without introducing another repair path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain main’s working RawData conversion and EventEmitter-backed fixture without introducing another repair path.

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

No current-main failing reproduction is established: source now repairs both reported mechanisms. Historical CI supports the original failures; tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes, the proposed changes narrowly repair the original test contracts, but main already supplies equivalent narrowing and a more faithful receiver fixture.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8f463a22fce0; fix evidence: commit 8f463a22fce0, main fix timestamp 2026-09-17T06:10:01Z.

Labels

Label changes:

  • add P3: This is a test-only maintenance patch whose intended repairs already exist on current main.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a test-only maintenance patch whose intended repairs already exist on current main.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Verified introduced patch: The pinned merge-base-to-head diff contains only RawData narrowing and two shared-fixture methods. Assertions, production behavior, dependencies, and configuration are unchanged. (extensions/slack/src/monitor/provider.interop.test.ts:508, 9410d85f0385)
  • Current-main implementation and history: Current main narrows ArrayBuffer before Buffer.from and supplies an EventEmitter-backed receiver fixture with an asynchronous sender. The inspected commit patch explicitly repairs both defects. (extensions/slack/src/monitor.test-helpers.ts:517, 8f463a22fce0)
  • Merged repair verified on GitHub: GitHub confirms feat: report session list CPU time in diagnostics #149291 merged at 2026-09-17T06:10:02Z with the inspected main commit. Its body explicitly documents both Slack repairs, 120 passing selected tests, and passing extension test types. (8f463a22fce0)
  • Release inclusion: No available tag contains the repair commit. Its verified presence is on the fetched current main; release inclusion is not established. (8f463a22fce0)
  • Pinned WebSocket type contract: The published @types/ws 8.18.1 declaration defines RawData as Buffer | ArrayBuffer | Buffer[]. The package metadata identifies DefinitelyTyped/DefinitelyTyped as its source repository. This directly supports the changed WebSocket message callback’s narrowing. (types/ws/index.d.ts:205)
  • Fixture contract and retained coverage: The production guard requires client.send and calls listeners, off, and on during construction. The full interop test retains real SDK socket cases asserting control and message acknowledgements, one ordinary dispatch, and a surviving connection. (extensions/slack/src/monitor/socket-mode-envelope.ts:17, 9410d85f0385)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • pash-openai: 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-17T05:43:43.024Z sha 68f9e9d0d33b3aa95c7053894f94b468bd4b2174 :: needs maintainer review before merge. :: none

@RomneyDa

Copy link
Copy Markdown
Member Author

Superseded by #149291, which merged both required repairs on current main:

  • narrows RawData into Buffer | ArrayBuffer before buffering
  • models the Socket Mode client as an EventEmitter with the SDK acknowledgement sender

The replacement is stronger than this branch's fixture-only listeners stub and its exact-head CI is already green. Closing this duplicate so #142018 can rebase onto the canonical base repair.

@RomneyDa RomneyDa closed this Sep 17, 2026
auto-merge was automatically disabled September 17, 2026 06:24

Pull request was closed

@steipete

Copy link
Copy Markdown
Contributor

Thank you @RomneyDa. The same narrowing landed on main in 8f463a2 (#149291), which also aligned the shared Socket Mode fixtures so the extension test-type graph and the full Slack suite pass again on clean main (verified on c498796: 165 files / 3,065 tests). Closing this one as superseded so it does not sit red on the guard failures; your fix was the right shape and is credited here.

steipete added a commit that referenced this pull request Sep 17, 2026
…50656)

Complete the Slack Socket Mode envelope-guard construction repair following #150608 by @pash-openai. Require an explicit acknowledgement callback and bind the SDK sender during receiver construction, preserving SDK ownership of serialization and transport, event-less envelope acknowledgements, and continued ordinary message delivery.

Complete the receiver fixture and await the Enterprise startup fixture's actual start signal while retaining the exact call-count assertion. No operator action, configuration change, or migration is required.

Validation: 3,063 Slack tests across 165 files and full test typechecking passed on the patch-identical reviewed revision. Exact-head CI run 35190855262 is green; the scoped-clean review and exact-head ClawSweeper review have no actionable findings. Transport proof uses the real Slack SDK over isolated loopback sockets.

Related: #150608, #150630
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…enclaw#150656)

Complete the Slack Socket Mode envelope-guard construction repair following openclaw#150608 by @pash-openai. Require an explicit acknowledgement callback and bind the SDK sender during receiver construction, preserving SDK ownership of serialization and transport, event-less envelope acknowledgements, and continued ordinary message delivery.

Complete the receiver fixture and await the Enterprise startup fixture's actual start signal while retaining the exact call-count assertion. No operator action, configuration change, or migration is required.

Validation: 3,063 Slack tests across 165 files and full test typechecking passed on the patch-identical reviewed revision. Exact-head CI run 35190855262 is green; the scoped-clean review and exact-head ClawSweeper review have no actionable findings. Transport proof uses the real Slack SDK over isolated loopback sockets.

Related: openclaw#150608, openclaw#150630
@RomneyDa
RomneyDa deleted the fix/slack-ws-rawdata-buffer-type branch October 22, 2026 00:22
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 size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants