Skip to content

Re-enable McpInvocationTests.A_cancelled_call_writes_no_audit_record_and_never_completes_the_invoker once the SDK ships the cancellation fix #224

Description

@The-Running-Dev

This test is currently skipped (D5-S16's PR) because it hangs indefinitely — confirmed with VSTest's --blame-hang and SDK trace logging, both locally and on a clean GitHub Actions runner.

Root cause, traced and confirmed: ModelContextProtocol.Core 2.2.0's client, not Platform. Cancelling client.CallToolAsync's CancellationToken over the streamable-HTTP transport aborts the client's own wait, but the client never sends the notifications/cancelled message to the server. The server-side invoker's token is therefore never triggered, and the test's invokerSawCancellation.Task waits forever.

This matches a confirmed, open upstream bug: modelcontextprotocol/csharp-sdk#1365"the client does take a CancellationToken however it seems to just abort the http request and not send a cancellation notification." The fix is PR #1377, unmerged as of this writing.

Platform's own server-side wiring (PlatformMcpTool.InvokeAsync passing the SDK-provided token straight through to IToolInvoker.InvokeAsync) is correct and unaffected by this bug — there is nothing to fix in this repository beyond bumping the package once a release includes the fix.

Action: once ModelContextProtocol.Core/ModelContextProtocol.AspNetCore ship a version containing the #1377 fix, bump the package reference in src/SubZeroDev.Platform.Mcp/SubZeroDev.Platform.Mcp.csproj, remove the Skip from tests/SubZeroDev.Platform.Tests/McpInvocationTests.cs's A_cancelled_call_writes_no_audit_record_and_never_completes_the_invoker, and confirm it passes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions