Skip to content

fix(sse): propagate malformed Anthropic JSON - #329

Merged
404-Page-Found merged 6 commits into
mainfrom
fix/307-anthropic-sse-json
Sep 24, 2026
Merged

404-Page-Found merged 6 commits into
mainfrom
fix/307-anthropic-sse-json

Conversation

@404-Page-Found

@404-Page-Found 404-Page-Found commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • propagate malformed JSON errors from Anthropic message_start and content_block_delta SSE frames
  • keep the error provider-specific and consistent with the OpenAI SSE parser
  • add parser regressions for both event types
  • add an end-to-end streaming regression that verifies the parser error releases the response body

Fixes #307

Verification

  • Reviewed the two-file diff against main
  • Local test execution was unavailable because this environment cannot resolve github.com; repository PR checks should provide the executable verification

Review in cubic

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 48b019ac-0e53-45e6-a346-880889901154

📥 Commits

Reviewing files that changed from the base of the PR and between 65718e4 and 23cf8f1.

📒 Files selected for processing (2)
  • src/providers/sse.ts
  • tests/stream-sse.test.mjs

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread src/providers/sse.ts
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. This PR fixes a bug where malformed Anthropic SSE JSON was silently ignored and instead propagates a provider-specific parse error, with parser and end-to-end regression tests. The change preserves non-delta/message_start behavior, adds null handling, and is tightly scoped to parser error handling.

Re-trigger cubic

@404-Page-Found
404-Page-Found merged commit 781f827 into main Sep 24, 2026
7 checks passed
@404-Page-Found
404-Page-Found deleted the fix/307-anthropic-sse-json branch September 24, 2026 01:31
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.

[Bug] Anthropic SSE streaming silently drops malformed JSON frames

1 participant