Skip to content

refactor(mcp): observe probes without replacing SDK callbacks - #177150

Merged
steipete merged 1 commit into
mainfrom
fix/fix10-mcp-probe-listeners
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/fix10-mcp-probe-listeners

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #176864

What Problem This Solves

Removes the six production lint suppressions introduced by the native MCP negotiation probe in acb98db (#176864), without expanding the suppression allowance.

User Impact

There is no intended user-visible change. Legacy MCP fallback still requires a spontaneous probe exit, and remains forbidden after I/O failure or requested cleanup. SDK callbacks and owned-process cleanup retain their existing behavior.

Why This Change Was Made

The stdio transport now publishes exit/error notifications before its existing SDK callbacks. The probe attaches and removes event listeners instead of replacing the SDK callback slots. An explicit receiver type preserves the exact saved send/close methods and their restoration without unbound-method suppressions.

This preserves #176864's stated contract: “Existing callers retain explicit legacy negotiation and the existing v1-shaped result boundary.” Main subsequently added these suppressions to the inventory in ab76239; this change removes both entries along with the actual suppressions. No dependency, timeout, assertion or lint rule changes.

Evidence

Focused local proof uses --maxWorkers=1: the suppression inventory and native MCP real-connect, stdio transport, process-group cleanup and stderr tests all pass (46 tests; 46.39 s wrapper). The real peers prove successful legacy fallback, no restart after an oversized frame, and complete child-process cleanup. Five owner-fixture modes preserve exit/error/send/close/detached decisions and SDK callback delivery.

Targeted agents-root tsgo, typed core lint, boundary lint, formatting and whitespace checks pass. Independent P2 autoreview is scoped-clean. The strict stdio client and real retained-relay cleanup suites also pass (11 tests; 48.60 s wrapper), covering callback-driven fatal errors, forced cleanup, uncertain cleanup, reaping, and fresh connection after disposal. PR CI supplies broad proof; no CI reruns were requested.

Remove the six lint suppressions introduced by acb98db (#176864).
Publish transport exit/error notifications before the unchanged SDK
callbacks and detach probe listeners explicitly. Preserve exact send/close
method identities with explicit receiver types and retain existing legacy
restart, failure and process-cleanup policy.

Shrink the two suppression inventory entries added in ab76239 rather
than expanding the allowlist. Cover spontaneous exit, I/O failure, failed
send, requested close and detach through the transport owner.

Proof: 57 focused tests with --maxWorkers=1, including real negotiation
peers, process-group cleanup and retained relay cleanup; targeted types,
typed and boundary lint, formatting, and independent P2 review all pass.
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review ended

ClawSweeper stopped reviewing this revision because the pull request closed.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 19, 2026 08:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:48:56.749665Z 5168298 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 19, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@steipete
steipete merged commit deb2f56 into main Oct 19, 2026
201 of 207 checks passed
@steipete
steipete deleted the fix/fix10-mcp-probe-listeners branch October 19, 2026 08:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…aw#177150)

Remove the six lint suppressions introduced by dc1ccbd (openclaw#176864).
Publish transport exit/error notifications before the unchanged SDK
callbacks and detach probe listeners explicitly. Preserve exact send/close
method identities with explicit receiver types and retain existing legacy
restart, failure and process-cleanup policy.

Shrink the two suppression inventory entries added in accd494 rather
than expanding the allowlist. Cover spontaneous exit, I/O failure, failed
send, requested close and detach through the transport owner.

Proof: 57 focused tests with --maxWorkers=1, including real negotiation
peers, process-group cleanup and retained relay cleanup; targeted types,
typed and boundary lint, formatting, and independent P2 review all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant