Skip to content

Comments

fix(provider-utils): fix SSE parser bug (CRLF)#6197

Merged
lgrammel merged 3 commits intovercel:mainfrom
twxia:provider-utils-event-source-parser-stream-bug
May 7, 2025
Merged

fix(provider-utils): fix SSE parser bug (CRLF)#6197
lgrammel merged 3 commits intovercel:mainfrom
twxia:provider-utils-event-source-parser-stream-bug

Conversation

@twxia
Copy link
Contributor

@twxia twxia commented May 7, 2025

CRLF pointer was incorrectly implemented in event-source-parser-stream

Background

The below MCP SSE message will make the stream reader timeout.

data: /message?sessionId=123\r\nevent: endpoint

Summary

Fix the splitLines parser issue. The CRLF pointer was incorrectly implemented.

Verification

pnpm test

Tasks

  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

@@ -0,0 +1,5 @@
---
'@ai-sdk/provider-utils': major
Copy link
Collaborator

Choose a reason for hiding this comment

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

change to patch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed at 8c7fcc7

@lgrammel lgrammel changed the title fix(provider-utils): SSE parser bug (CRLF) fix(provider-utils): fix SSE parser bug (CRLF) May 7, 2025
'@ai-sdk/provider-utils': major
---

SSE parser bug (CRLF should be handled correctly)
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls change to fix(provider-utils): fix SSE parser bug (CRLF)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed at 8c7fcc7

twxia added 3 commits May 7, 2025 12:46
CRLF pointer was incorrectly implemented in event-source-parser-stream
@twxia twxia force-pushed the provider-utils-event-source-parser-stream-bug branch from da881f2 to 8c7fcc7 Compare May 7, 2025 11:46
@lgrammel lgrammel merged commit d87b9d1 into vercel:main May 7, 2025
7 of 8 checks passed
lgrammel pushed a commit that referenced this pull request May 7, 2025
## Background

The below MCP SSE message will make the stream reader timeout.  
```
data: /message?sessionId=123\r\nevent: endpoint
```

## Summary

Fix the `splitLines` parser issue. The CRLF pointer was incorrectly
implemented.
lgrammel added a commit that referenced this pull request May 7, 2025
## Background

The below MCP SSE message will make the stream reader timeout.  
```
data: /message?sessionId=123\r\nevent: endpoint
```

## Summary

Fix the `splitLines` parser issue. The CRLF pointer was incorrectly
implemented.

Co-authored-by: Wei-Chieh Hsia <passion804222@gmail.com>
iteratetograceness pushed a commit to iteratetograceness/ai that referenced this pull request May 9, 2025
…6200)

## Background

The below MCP SSE message will make the stream reader timeout.  
```
data: /message?sessionId=123\r\nevent: endpoint
```

## Summary

Fix the `splitLines` parser issue. The CRLF pointer was incorrectly
implemented.

Co-authored-by: Wei-Chieh Hsia <passion804222@gmail.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.

2 participants