Repository navigation
fix(slack): Socket Mode logs a warning for every ping from another undici copy - #164305
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 9:07 AM ET / 13:07 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Slack plugin suppresses two exact foreign-WebSocket heartbeat warnings and extends its logger regression coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary, and the updated production-logger trace resolves the previous proof blocker. No actionable correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherSlack Socket Mode receives events over a persistent WebSocket. Its SDK sends diagnostics through OpenClaw’s receiver logger, which filters known noise before forwarding warnings and errors to Gateway logs. flowchart TD
A[Slack WebSocket] --> C[SDK heartbeat diagnostics]
B[Other WebSockets] --> C
C --> D[Socket Mode logger]
D --> E{Known noise?}
E -->|Yes| F[Suppress warning]
E -->|No| G[Gateway logs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +9, Tests +2. Total +11 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep selective noise suppression at the existing Slack logger boundary while preserving socket health behavior and actionable diagnostics. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the foreign-constructor diagnostics path, and the contributor supplies a matching before/after real-SDK trace; this reviewer did not execute it. Is this the best way to solve the issue? Yes, the exact-message filter extends the existing logger owner without changing transport behavior; dependency version alignment cannot cover all foreign constructors. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f965e0ea73ef. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
altaywtf
left a comment
There was a problem hiding this comment.
I reproduced this on main and verified 5ea15b6e. No actionable findings.
- Real ping/pong frames through the production receiver logger produce both warnings on main; this head removes them. Reverting the fix restores both.
- Owned heartbeat state, other warnings, near-match messages and errors remain intact. The focused logger, reconnect and envelope tests pass.
- I did not measure a live multi-account Slack Gateway or production log-volume reduction.
|
Merged via squash.
|
…dici copy (openclaw#164305) * test(slack): cover foreign undici ping diagnostics warnings * fix(slack): drop foreign undici ping diagnostics warnings --------- Co-authored-by: Jay Zhou <[email protected]>
Closes #164266
What Problem This Solves
Fixes: the Slack Socket Mode client logs
Received unexpected ping diagnostics message formatat WARN for every ping or pong frame from a WebSocket that another undici copy in the Gateway built. The report measured this at 19% of all Gateway log lines.User Impact
User impact: Gateway logs no longer fill with this warning on installs where the Slack plugin and core load different undici copies. Socket health, heartbeat timeouts, and every other Socket Mode warning and error are unchanged.
Why This Change Was Made
@slack/socket-mode3.0.1 subscribes eachSlackWebSocketto undici's process-wideundici:websocket:pingandundici:websocket:pongdiagnostics channels. It warns before it checks whether the frame belongs to its own socket, and its check isinstanceofits own undici'sWebSocket. Frames from any WebSocket built by another undici copy, such as core's, fail that check and warn instead of being ignored. Aligning undici versions would not cover every foreign constructor, sinceclient-options.tsalready resolves Socket Mode's own copy.createSlackSocketModeLoggerinextensions/slack/src/monitor/provider-support.tsalready drops two known non-actionable SDK warnings (heartbeat timeouts and the ignoredlogLevelnotice). It now drops these two exact diagnostics strings too. The SDK only emits them when a diagnostics message lacks its ownWebSocketinstance, and the handler returns without touching connection state, so nothing actionable is lost.Evidence
test(slack)commit af61a97 adds the ping and pong diagnostics warnings to "filters Socket Mode noise and retains SDK errors through the configured receiver logger" inextensions/slack/src/monitor/provider.interop.test.ts. On upstream/main 4c0c0c0 it fails withexpected "warn" to be called 1 times, but got 3 times. On fix 5ea15b6: 13/13 pass.pnpm test extensions/slack/src/monitor/: 74 files, 1127 passed.pnpm tsgo:extensionsexit 0.scripts/run-oxlint.mjsexit 0 andoxfmt --checkclean on both changed files.createSlackBoltAppfrom the real@slack/bolt(socket mode, so the receiver logger iscreateSlackSocketModeLogger), then constructs the realSlackWebSocketfrom Bolt's own@slack/socket-mode3.0.1 ([email protected]) with that receiver's logger. It connects to a localwsserver alongside a second socket built by Node's bundled undici (a foreignWebSocketclass), and the server sends a real ping and an unsolicited pong to both. The SDK socket's own frames are ignored as usual. The foreign socket's frames reach the SDK's diagnostics handlers. A laterwarnwith an unrelated message checks that the logger still forwards everything else.console.warncaptured on each side:Not verified: a live Gateway with four Slack accounts connected to Slack over hours. The probe runs real frames through the real SDK and the production receiver logger against a local server, but the log-volume drop on a real install was not measured.
AI disclosure: an AI agent (Claude Code) traced the root cause in the Socket Mode SDK, wrote the test and the fix, and ran the gates above:
pnpm test extensions/slack/src/monitor/provider.interop.test.ts --maxWorkers=1,pnpm test extensions/slack/src/monitor/,pnpm tsgo:extensions,scripts/run-oxlint.mjs,oxfmt --check, and the SDK boundary probe above.🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309.