Skip to content

fix: don't respond to cancelled requests#957

Open
DaleSeo wants to merge 1 commit into
mainfrom
fix/drop-response-for-cancelled-request
Open

fix: don't respond to cancelled requests#957
DaleSeo wants to merge 1 commit into
mainfrom
fix/drop-response-for-cancelled-request

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jul 5, 2026

Copy link
Copy Markdown
Member

Motivation and Context

This fixes the service loop so a locally produced response is not sent after the peer has already cancelled the matching request. The existing cancellation path removes the request id from local_ct_pool, so the response path now treats a missing id as the signal to suppress the late response instead of writing it to the transport. This keeps cancellation best-effort and race-safe while matching the MCP guidance that a receiver should not respond to a cancelled request.

How Has This Been Tested?

Add integration tests

Breaking Changes

None.

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

@DaleSeo DaleSeo self-assigned this Jul 5, 2026
@DaleSeo DaleSeo requested a review from a team as a code owner July 5, 2026 15:20
@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes labels Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant