Skip to content

🐛✅ SSE event could start with id#93

Merged
evaline-ju merged 1 commit intokagenti:mainfrom
evaline-ju:sse-edgecase
Apr 7, 2026
Merged

🐛✅ SSE event could start with id#93
evaline-ju merged 1 commit intokagenti:mainfrom
evaline-ju:sse-edgecase

Conversation

@evaline-ju
Copy link
Copy Markdown
Contributor

Summary

For a tool on the everything MCP server registered through MCP gateway, instead of getting an expected tool response block, the tool response was let through with error logs in the adapter

DEBUG:ext-proc-PM:Response body text: ['id:
f1833ebe-5ad3-4c9f-8acf-4117f8c76d4e_1775582473900_fvcrthoy', 'data: ', '', 'event: message', 'id:
f1833ebe-5ad3-4c9f-8acf-4117f8c76d4e_1775582473900_esl5mn10', 'data:
{"result":{"content":[{"type":"text","text":"Echo: my password is secret"}]},"jsonrpc":"2.0","id":10}', '', '']
ERROR:ext-proc-PM:Failed to parse JSON: Expecting value: line 1 column 1 (char 0).

This PR fixes this and adds a unit test for the case where the event starts with id

Related issue(s)

Fixes #92

Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
@evaline-ju evaline-ju requested a review from a team as a code owner April 7, 2026 17:46
Copy link
Copy Markdown
Collaborator

@julianstephen julianstephen left a comment

Choose a reason for hiding this comment

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

Looks gd.

@evaline-ju evaline-ju merged commit ccb0fdb into kagenti:main Apr 7, 2026
12 checks passed
@evaline-ju evaline-ju deleted the sse-edgecase branch April 7, 2026 23:20
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.

🐛 SSE response bodies starting with id: field bypass parsing and fail with JSON error

2 participants