Skip to content

Fix duplicate client send error reporting - #1119

Open
skulitom wants to merge 9 commits into
modelcontextprotocol:mainfrom
skulitom:codex/fix-client-send-error-reporting
Open

skulitom wants to merge 9 commits into
modelcontextprotocol:mainfrom
skulitom:codex/fix-client-send-error-reporting

Conversation

@skulitom

Copy link
Copy Markdown

Fix client send failures being reported both through an exception and through onError.

Motivation and Context

Fixes #1034.

When sending an error reply fails, AbstractClientTransport.send() reports the failure and throws it, then Protocol reports it again. HTTP status and response-parsing failures add their own duplicate reports. Let these synchronous send failures propagate to their caller, preserving exception wrapping, causes and cancellation. Background errors and non-throwing SSE error events still use onError.

How Has This Been Tested?

  • Added seven tests and updated four existing expectations. Ten regression assertions fail on unchanged main; all 45 focused tests pass with the fix.
  • Windows: 327 core, client and testing-module JVM tests pass.
  • WSL/Linux: all 611 JVM tests pass, including 119 integration tests; repository-wide ktlintCheck passes.
  • Repository-wide checkKotlinAbi passes.
  • JavaScript/Node: all 296 core, client and testing-module tests pass.
  • All four client conformance scenarios pass (10 checks), including SSE reconnect/retry.

Breaking Changes

No public signatures or wire formats change. Callback behavior changes as requested in #1034: callers handle thrown send failures, and onError no longer repeats those failures. Background error reporting is preserved.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Prepared with Codex assistance for investigation, implementation and local validation.

Core/client Detekt tasks exit successfully. The core analyzer reports 110 compiler-resolution errors on both this branch and pristine main (dbea361), so that pre-existing warning limits its analysis accuracy.

@chatgpt-codex-connector

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

Copy link
Copy Markdown

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-16T11:18:04.960847Z 12e637e PR opened
ℹ️ 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.

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

Copy link
Copy Markdown

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: 12e637eae2

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

jetbrains-air[bot]
jetbrains-air Bot previously approved these changes Oct 16, 2026

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Happy to take another look once the one blocking inline note is addressed.

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Happy to approve this one — no blocking findings.

Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=3086f0f3-04cc-4733-be5e-5770eac22142

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the careful iteration here — one last blocking item in the new response-send catch and this is good to go!

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nicely done on the cancellation handling — approving.

Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=27f56692-74d6-43bb-9bb3-8ea7ee4a5a1b

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All three earlier findings are properly resolved and the full JVM suite is green here — happy to approve this one!

Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=61d88fba-3abc-440c-8ae3-c5e4e865dc1f

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client transports report a failed send twice

1 participant