Skip to content

Keep raw response when pending result decoding fails - #292

Open
EhsanAzish80 wants to merge 1 commit into
modelcontextprotocol:mainfrom
EhsanAzish80:fix/pending-response-diagnostics
Open

EhsanAzish80 wants to merge 1 commit into
modelcontextprotocol:mainfrom
EhsanAzish80:fix/pending-response-diagnostics

Conversation

@EhsanAzish80

@EhsanAzish80 EhsanAzish80 commented Sep 24, 2026 •

Copy link
Copy Markdown

When a response cannot decode as the expected result type, TypeMismatchError now includes the expected type, raw value and underlying decoding error. This gives clients enough information to diagnose issue #220 without changing how valid responses decode.

Tests: 554 Swift tests passed locally, including malformed, valid and non-JSON response cases.

AI assistance was used to write the code and tests.The diff was checked and the tests were run locally.

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.

1 participant