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.
This test is currently skipped (D5-S16's PR) because it hangs indefinitely — confirmed with VSTest's
--blame-hangand SDK trace logging, both locally and on a clean GitHub Actions runner.Root cause, traced and confirmed:
ModelContextProtocol.Core2.2.0's client, not Platform. Cancellingclient.CallToolAsync'sCancellationTokenover the streamable-HTTP transport aborts the client's own wait, but the client never sends thenotifications/cancelledmessage to the server. The server-side invoker's token is therefore never triggered, and the test'sinvokerSawCancellation.Taskwaits 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.InvokeAsyncpassing the SDK-provided token straight through toIToolInvoker.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.AspNetCoreship a version containing the #1377 fix, bump the package reference insrc/SubZeroDev.Platform.Mcp/SubZeroDev.Platform.Mcp.csproj, remove theSkipfromtests/SubZeroDev.Platform.Tests/McpInvocationTests.cs'sA_cancelled_call_writes_no_audit_record_and_never_completes_the_invoker, and confirm it passes.