Skip to content

fix(mcp): always log channel-bridge notification failures#92032

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
hansraj316:fix/mcp-bridge-notification-log
Jun 10, 2026
Merged

fix(mcp): always log channel-bridge notification failures#92032
vincentkoc merged 1 commit into
openclaw:mainfrom
hansraj316:fix/mcp-bridge-notification-log

Conversation

@hansraj316

Copy link
Copy Markdown
Contributor

Summary

MCP channel-bridge notification delivery failures were only logged when verbose, otherwise fully swallowed. Emit one low-noise diagnostic on a non-closed failure always; gate only the error detail behind verbose.

  • Files: src/mcp/channel-bridge.ts
  • No CHANGELOG.md edit (release-only per AGENTS.md).

Why core (not ClawHub)

Core correctness fix touching src/mcp/channel-bridge.ts — per AGENTS.md these stay in core (security/core hardening, bundled regressions, missing core APIs), not optional skill bundles routed to ClawHub.

Verification

  • node scripts/run-vitest.mjs run src/mcp/channel-bridge.test.ts => 10 passed
  • pnpm tsgo:core (tsconfig.core.json) => clean
  • oxfmt --check + oxlint on touched files => clean

Real behavior proof

  • Behavior addressed: A failed MCP notification now always emits one diagnostic record; verbose adds the error detail.
  • Real environment tested: macOS (Darwin 25.3.0); OpenClaw at base 2accfee; Node 22; Vitest via scripts/run-vitest.mjs.
  • Exact steps or command run after this patch: node scripts/run-vitest.mjs run src/mcp/channel-bridge.test.ts
  • Evidence after fix: 10 tests pass, incl. a new case: a failed notification with verbose off emits exactly one diagnostic record and does not leak the error string.
  • Observed result after fix: Preserves prior swallow-on-close behavior (notifications can reject because the transport closed); callers still see void.
  • What was not tested: Full Crabbox/live MCP E2E; Linux CI.. Independently reviewed by a separate agent before commit; not yet run through Crabbox/$autoreview.

🤖 Generated with Claude Code

MCP channel-bridge notification failures were only logged when verbose,
otherwise swallowed. Emit one low-noise diagnostic always; gate only the
error detail behind verbose.
@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f2b3217df

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcp/channel-bridge.ts
Comment on lines +386 to +389
process.stderr.write(`openclaw mcp: notification ${notification.method} failed\n`);
if (this.verbose) {
process.stderr.write(
`openclaw mcp: notification ${notification.method} failed: ${String(error)}\n`,
`openclaw mcp: notification ${notification.method} error: ${String(error)}\n`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep verbose failures in one diagnostic record

When openclaw mcp serve --verbose encounters a notification rejection, this unconditional write is followed by the verbose write below, so one failure now produces two records instead of the previous single detailed record. This also contradicts the commit's stated one-record behavior and can double failure counts in line-oriented log collectors; construct one message whose error suffix is conditional, and cover the verbose path in the test.

Useful? React with 👍 / 👎.

@vincentkoc vincentkoc self-assigned this Jun 10, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete.

  • Rebased onto current origin/main.
  • Focused proof: node scripts/run-vitest.mjs src/mcp/channel-bridge.test.ts — 10 tests passed.
  • Fresh autoreview: clean, no accepted/actionable findings.
  • Best-fix judgment: yes. Failures become observable without changing the bridge's non-throwing behavior or exposing transport details outside verbose logs.

@vincentkoc
vincentkoc merged commit 5d6899c into openclaw:main Jun 10, 2026
174 of 178 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 11, 2026
…2032)

MCP channel-bridge notification failures were only logged when verbose,
otherwise swallowed. Emit one low-noise diagnostic always; gate only the
error detail behind verbose.
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
…2032)

MCP channel-bridge notification failures were only logged when verbose,
otherwise swallowed. Emit one low-noise diagnostic always; gate only the
error detail behind verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants