Skip to content

fix(slack): retire probe sockets after timeout - #147846

Merged
steipete merged 1 commit into
mainfrom
codex/bun-slack-probe-dispatcher
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/bun-slack-probe-dispatcher

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Problem

A timed-out Slack health probe can return while its HTTP socket remains pooled. Under Bun and a loaded non-isolated Slack test process, the stalled-request and trickling-body cases intermittently kept their only socket open beyond the probe deadline.

Solution

Give each Slack health probe its own shared HTTP/1 env-proxy dispatcher, pass that dispatcher into the existing read-client owner, and destroy it after the probe settles. Invalid ambient proxy settings retain the existing direct-health-check fallback, now through a direct owned dispatcher. Ordinary Slack clients keep their existing shared transport behavior.

The dedicated lifecycle also makes the ownership explicit: health probes do not retain a reusable connection pool after returning.

Validation

  • Bun real transport deadline cases: 20 repeated executions, all passed
  • Node and Bun focused probe behavior/lifecycle: 12/12 each
  • Bun full Slack shard: 3,040/3,040
  • node scripts/check-changed.mjs
  • Fresh exact-commit P0-P2 autoreview: clean

A direct Bun fetch reproduction and a bare Slack WebClient reproduction each closed stalled and trickling sockets in 20/20 attempts. The failure requires OpenClaw's loaded Slack process, so there is no isolated Bun runtime report to send upstream from this evidence.

Release-note context: Slack health checks now retire timed-out probe sockets reliably, including when OpenClaw runs under Bun.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 12:06 AM ET / 04:06 UTC.

ClawSweeper review

What this changes

Give Slack health checks their own HTTP connection pool and destroy it when each check finishes, including after a timeout.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused lifecycle fix absent from current main and the latest release. No introduced correctness or security defect was found, and the maintainer-protected PR remains useful.

Priority: P2
Reviewed head: b32198040be03b80a72e820479c2ec76ea6aed94

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant existing transport coverage and no actionable introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer author, so the external-contributor proof gate does not apply; reported Node/Bun runs exercise the production probe through real loopback sockets, but no execution was independently repeated here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer author, so the external-contributor proof gate does not apply; reported Node/Bun runs exercise the production probe through real loopback sockets, but no execution was independently repeated here.
Evidence reviewed 7 items Introduced lifecycle change: The pinned introduction delta creates a probe-owned dispatcher, passes it through the existing read-client options owner, and awaits destruction in finally. The verified test-merge result contains the same four-file scope.
Current main still lacks explicit retirement: Fetched main configures the existing timeout and zero-retry policy but returns runChannelProbe without owning or destroying a dispatcher.
Latest-release comparison: The supplied latest release, v2026.9.4, also lacks probe-owned dispatcher retirement.
Findings None None.
Security None None.

How this fits together

Slack health checks send an authentication request using the configured account token and return connection and identity information to diagnostics. The changed transport lifecycle releases the check's sockets before returning that result.

flowchart TD
  A[Channel diagnostics] --> B[Account token and deadline]
  B --> C[Slack health probe]
  C --> D[Dedicated HTTP transport]
  D --> E[Slack authentication response or timeout]
  E --> F[Destroy probe sockets]
  F --> G[Health result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +33, Tests +21. Total +54 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 43 10 +33
Tests 1 36 15 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 79 25 +54

Review metrics

None.

Technical review

Best possible solution:

Keep socket retirement with the probe owner while preserving shared transports for ordinary Slack operations.

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

Unclear for independent reproduction: the real-transport harness covers the reported failure, but the intermittent loaded-Bun trigger was reported by the author and was not executed in this read-only review.

Is this the best way to solve the issue?

Yes: explicit disposal at the probe boundary reuses the existing transport owner and avoids changing ordinary Slack request lifetimes.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs bounded Slack diagnostic socket retention without evidence of a broader production outage.
  • 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: The supplied repository state identifies a maintainer author, so the external-contributor proof gate does not apply; reported Node/Bun runs exercise the production probe through real loopback sockets, but no execution was independently repeated here.

Label justifications:

  • P2: This repairs bounded Slack diagnostic socket retention without evidence of a broader production outage.
  • 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: The supplied repository state identifies a maintainer author, so the external-contributor proof gate does not apply; reported Node/Bun runs exercise the production probe through real loopback sockets, but no execution was independently repeated here.

Evidence

What I checked:

  • Introduced lifecycle change: The pinned introduction delta creates a probe-owned dispatcher, passes it through the existing read-client options owner, and awaits destruction in finally. The verified test-merge result contains the same four-file scope. (extensions/slack/src/probe.ts:25, b32198040be0)
  • Current main still lacks explicit retirement: Fetched main configures the existing timeout and zero-retry policy but returns runChannelProbe without owning or destroying a dispatcher. (extensions/slack/src/probe.ts:24, ae5a4b4a5552)
  • Latest-release comparison: The supplied latest release, v2026.9.4, also lacks probe-owned dispatcher retirement. (extensions/slack/src/probe.ts:24, 3a9d69db306c)
  • Transport ownership and compatibility: The shared dispatcher implementation destroys both direct and proxy children. Slack retains its existing environment-proxy resolution, malformed-proxy fallback, and debug-capture path; the new dispatcher parameter is private to the plugin rather than a new public SDK API. (src/infra/net/undici-runtime.ts:132, b32198040be0)
  • Regression coverage and reported execution: The complete existing transport test invokes probeSlack with the real Slack SDK against loopback HTTP servers and checks socket disappearance after stalled and trickling responses. The captured PR body reports 20 passing Bun repetitions, 12 focused cases each on Node and Bun, and 3,040 passing Slack tests. These reported executions were not rerun during this read-only review. (extensions/slack/src/probe.transport.test.ts, b32198040be0)
  • Earlier fix addresses overlapping deadline behavior: GitHub verifies fix(slack): keep health probes within their timeout #107835 as merged. Its body distinguishes background retries and rate-limit waits from sockets that passed its earlier transport checks; it does not establish that the newly reported loaded-Bun failure is already fixed. (07768aa5f684)

Likely related people:

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

@steipete
steipete merged commit 1cb6d83 into main Sep 14, 2026
99 checks passed
@steipete
steipete deleted the codex/bun-slack-probe-dispatcher branch September 14, 2026 05:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit 'e3d8d0078369b21223c70028c4502c89f1420897': (51 commits)
  fix: background requests delay opening chats (#147845)
  chore(i18n): refresh native locales (#147899)
  feat: start remote sessions without a repository (#147773)
  fix(slack): retire probe sockets after timeout (#147846)
  refactor(agents): share theme ANSI color encoding (#147838)
  improve(memory): bound vector recall decision counts (#147900)
  improve(browser): narrow dashboard lifetime rechecks (#147892)
  test(discord): compact lifecycle matrices (#147855)
  fix(agents): use exact model rows for harness support (#147849)
  test(agents): compact embedded lifecycle matrices (#147856)
  test(agents): compact embedded admission matrices (#147853)
  test(cli): compact node management matrices (#147854)
  feat(artifacts): select assistant-delivered files by run (#147682)
  improve: reduce event-loop work when recording prompts (#147876)
  fix: preserve readable generated image and video filenames (#147833)
  fix(ci): skip SDK rendering for identical revisions (#147572)
  fix: prevent false process failures and stalled background waits (#147871)
  fix(ui): restore live updates when retrying chat history (#147865)
  fix(ui): preserve text and image order in assistant replies (#147731)
  refactor(qa-lab): reuse approval result formatter (#147867)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
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 P2 Normal backlog priority with limited blast radius. 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