Skip to content

Fix SSE parsers to accept optional space after data: prefix#7929

Merged
jh-block merged 3 commits intoblock:mainfrom
NiltonVolpato:fix/sse-data-prefix-space
Mar 17, 2026
Merged

Fix SSE parsers to accept optional space after data: prefix#7929
jh-block merged 3 commits intoblock:mainfrom
NiltonVolpato:fix/sse-data-prefix-space

Conversation

@NiltonVolpato
Copy link
Copy Markdown
Contributor

Summary

  • Fix Anthropic, OpenAI, OpenAI Responses, and Snowflake SSE stream parsers to accept both data: value and data:value formats
  • Per the SSE spec, the space after the colon is optional

This fixes compatibility with Kimi Code's Anthropic-compatible API, which sends SSE events without the optional space.

Test plan

  • Existing tests pass (no change in behavior for data: format)
  • Verified manually against Kimi Code API — sessions now produce responses
  • Confirmed with intercepting proxy that both data: and data: formats are parsed correctly

Fixes #7928

🤖 Generated with Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31c4e672cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@NiltonVolpato NiltonVolpato force-pushed the fix/sse-data-prefix-space branch from 31c4e67 to fe3dcd6 Compare March 16, 2026 14:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe3dcd6ca5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Per the SSE spec, the space after the colon in "data: value" is
optional. Providers like Kimi Code send "data:{...}" without the
space, which caused all SSE events to be silently skipped, resulting
in "Stream yielded no message" errors.

Fix all four SSE parsers (Anthropic, OpenAI, OpenAI Responses,
Snowflake) to accept both "data: value" and "data:value" formats.

Fixes #7928

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Nilton Volpato <[email protected]>
@NiltonVolpato NiltonVolpato force-pushed the fix/sse-data-prefix-space branch from fe3dcd6 to 369bf86 Compare March 16, 2026 14:37
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 369bf86e28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The OpenAI SSE parser checked for the raw string "data: [DONE]"
before stripping the prefix, so "data:[DONE]" (no space) would
be passed to serde_json and fail. Move the [DONE] check to after
strip_data_prefix so both formats are handled consistently.

Fixes #7928

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Nilton Volpato <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ec2f3369d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Nilton Volpato <[email protected]>
@NiltonVolpato NiltonVolpato force-pushed the fix/sse-data-prefix-space branch from 1ec2f33 to 0481c86 Compare March 16, 2026 22:39
@jh-block jh-block added this pull request to the merge queue Mar 17, 2026
Merged via the queue into block:main with commit e075861 Mar 17, 2026
21 checks passed
jh-block added a commit that referenced this pull request Mar 18, 2026
…ct-ui

* origin/main:
  docs: add Remote Access section with Telegram Gateway documentation (#7955)
  fix: update webmcp blog post metadata image URL (#7967)
  fix: clean up OAuth token cache on provider deletion (#7908)
  fix: hard-coded tool call id in code mode callback (#7939)
  Fix SSE parsers to accept optional space after data: prefix (#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961)
  Add WebMCP for Beginners blog post (#7957)
  Fix download manager (#7933)

# Conflicts:
#	ui/desktop/src/api/index.ts
#	ui/desktop/src/api/sdk.gen.ts
jh-block added a commit to rabi/goose that referenced this pull request Mar 18, 2026
* main: (32 commits)
  Revert message flush & test (block#7966)
  docs: add Remote Access section with Telegram Gateway documentation (block#7955)
  fix: update webmcp blog post metadata image URL (block#7967)
  fix: clean up OAuth token cache on provider deletion (block#7908)
  fix: hard-coded tool call id in code mode callback (block#7939)
  Fix SSE parsers to accept optional space after data: prefix (block#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (block#7961)
  Add WebMCP for Beginners blog post (block#7957)
  Fix download manager (block#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (block#7626)
  don't imply running builds all the time in AGENTS.md (block#7865)
  fix: unregister goosed child process's  listener (block#7956)
  feat: adversarial agent for preventing leaking of info and more  (block#7948)
  Update contributing.md (block#7927)
  docs: add credit balance monitoring section (block#7952)
  docs: add Cerebras provider to supported providers list (block#7953)
  docs: add TUI client documentation to ACP clients guide (block#7950)
  fix: removed double dash in pnpm command (block#7951)
  docs: polish ACP docs (block#7946)
  claude adaptive thinking (block#7944)
  ...
lifeizhou-ap added a commit that referenced this pull request Mar 20, 2026
* main: (22 commits)
  feat: add gemini-acp provider, update docs on subscription models + improvements to codex (#8000)
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
  fix: overwrite the deprecated googledrive extension config (#7974)
  refactor: remove unnecessary Arc<Mutex> from tool execution pipeline (#7979)
  Revert message flush & test (#7966)
  docs: add Remote Access section with Telegram Gateway documentation (#7955)
  fix: update webmcp blog post metadata image URL (#7967)
  fix: clean up OAuth token cache on provider deletion (#7908)
  fix: hard-coded tool call id in code mode callback (#7939)
  Fix SSE parsers to accept optional space after data: prefix (#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961)
  Add WebMCP for Beginners blog post (#7957)
  Fix download manager (#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626)
  ...
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
Signed-off-by: Nilton Volpato <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: esnyder <[email protected]>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
Signed-off-by: Nilton Volpato <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: esnyder <[email protected]>
@NiltonVolpato NiltonVolpato deleted the fix/sse-data-prefix-space branch March 23, 2026 15:02
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.

Anthropic SSE stream parser fails with providers that omit space after data: prefix

2 participants