Skip to content

fix: handle UTF-8 BOM in JSON-RPC frames - #984

Draft
kkkhs wants to merge 1 commit into
modelcontextprotocol:mainfrom
kkkhs:agent/fix-stdio-bom-956
Draft

fix: handle UTF-8 BOM in JSON-RPC frames#984
kkkhs wants to merge 1 commit into
modelcontextprotocol:mainfrom
kkkhs:agent/fix-stdio-bom-956

Conversation

@kkkhs

@kkkhs kkkhs commented Sep 7, 2026

Copy link
Copy Markdown

What

Fixes #956. BOM-prefixed JSON-RPC frames currently fall into ReadBuffer's recovery path before parsing.

Fix

Normalize leading UTF-8 BOM characters before JSON-RPC deserialization, so stdio frames parse directly instead of logging a recovery error.

Test

Added a ReadBuffer regression for BOM-prefixed messages.

Copilot AI lite review requested due to automatic review settings September 7, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

StdioServerTransport fails to deserialize initial message when stdin starts with UTF-8 BOM

2 participants