Ensure all test client instances are cleaned up#3
Merged
Merged
Conversation
halter73
pushed a commit
that referenced
this pull request
Nov 12, 2025
PranavSenthilnathan
added a commit
to PranavSenthilnathan/csharp-sdk
that referenced
this pull request
Jun 11, 2026
Three related fixes to the task-store wrapper in McpServerImpl, all in the same catch chain around L920-970: modelcontextprotocol#2 - Failed payload shape + JsonDocument lifetime (SEP-2663 186) - Register JsonRpcErrorDetail in McpJsonUtilities source-gen context. - Replace JsonDocument.Parse(...).RootElement (leaks pooled buffer) with typed JsonRpcErrorDetail + SerializeToElement. - Emit {code, message} per spec; McpProtocolException preserves its ErrorCode + Message (documented safe to propagate); all other exceptions redact to InternalError + generic message. - Test: McpProtocolException_FromTool_StoresAsFailedWithJsonRpcErrorShape. modelcontextprotocol#3 - Orphan-on-IsTask=true - When TaskStore is configured AND CallToolWithTaskHandler returns IsTask=true, the store's pre-created task was left in Working forever. Now fails the store's task with a clear InternalError identifying the misconfiguration (use only one mechanism). - New test class: TaskStoreOrphanedTaskTests. modelcontextprotocol#4 - Dedicated InputRequiredException catch - When [McpServerTool] throws InputRequiredException under the task wrapper, it fell through to the generic catch and surfaced as a misleading Failed task. The taskId was already returned to the client synchronously, so InputRequiredResult cannot be surfaced retroactively. Now fails the task with an actionable InvalidRequest message pointing the user to CallToolWithTaskHandler. - Test: InputRequiredException_FromTool_FailsTaskWithActionableMessage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.