Skip to content

Fix STDIO transport crashing on incoming messages#243

Open
n0vdd wants to merge 1 commit intocloudwalk:mainfrom
n0vdd:fix/stdio-transport-message-list
Open

Fix STDIO transport crashing on incoming messages#243
n0vdd wants to merge 1 commit intocloudwalk:mainfrom
n0vdd:fix/stdio-transport-message-list

Conversation

@n0vdd
Copy link
Copy Markdown

@n0vdd n0vdd commented Feb 21, 2026

Summary

  • Message.decode/1 returns {:ok, messages} where messages is always a list, but the STDIO transport passed this list directly to process_message/2 which expects a single map
  • This caused a BadMapError on every incoming message via the STDIO transport
  • The StreamableHTTP transport already handles this correctly by pattern-matching {:ok, [message]} in handle_post/2
  • Fix: iterate over the decoded messages list with Enum.each/2

Test plan

  • Verified the fix resolves the BadMapError by sending initialize, notifications/initialized, and tools/list messages over stdio
  • Confirmed the StreamableHTTP Plug transport already destructures the list correctly (reference implementation)

🤖 Generated with Claude Code

Message.decode/1 returns {:ok, messages} where messages is a list,
but the STDIO transport passed this list directly to process_message/2
which expects a single map. This caused a BadMapError on every incoming
message.

The StreamableHTTP transport already handles this correctly by
pattern-matching {:ok, [message]} in handle_post/2. This fix iterates
over the decoded messages list, matching the expected behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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