Skip to content

Conversation

@paoloricciuti
Copy link

Background

SSE events should default to message as the event...both the SSE transport and the HTTP transport were explicitly checking for event message which means that servers that didn't explicitly emit events with an event name where hanging forever.

Summary

I've expanded the check to invoke the onmessage callback even when the event is undefined which is how SSE events should work.

Manual Verification

I've patched my version of ai sdk with the same changes and used a server that wasn't returning explicit event messages and verified that it worked.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Closes #10915

@vercel-ai-sdk vercel-ai-sdk bot added ai/gateway bug Something isn't working as documented labels Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/gateway bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP client doesn't default to message for SSE events

1 participant