Skip to content

fix(antigravity): parse unterminated SSE events - #786

Open
outlier27-cell wants to merge 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-784-antigravity-sse-eof
Open

outlier27-cell wants to merge 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-784-antigravity-sse-eof

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

Antigravity parsed data: fields one line at a time during normal SSE reads, but treated an unterminated EOF buffer as one line. A valid multi-line event without its final blank delimiter therefore failed JSON parsing.

Closes #784

Value

The provider accepts a valid final multi-line SSE event when a transport closes without its optional event delimiter.

Approach

  • Reuse one data: line collector during normal reads and EOF processing.
  • Add a stream-level regression with two data lines and no trailing blank line.

Validation

  • node --test --experimental-strip-types --test-name-pattern "unterminated multi-line SSE event" tests/extensions/ai-providers/antigravity.test.ts
  • bun run check
  • bun run test (Windows baseline failures outside this change: file-lock/symlink-permission and existing TUI assertions)

Impact

No API changes. Normal delimited SSE handling, timeouts, and cancellation behavior are unchanged.

@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@testikun @tt-a1i CI is green and the scoped regression coverage is complete. Please review when available.

@tt-a1i

tt-a1i commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks! I couldn't reproduce #784 on current main: with the provider change reverted, the new test streamAntigravity parses an unterminated multi-line SSE event at EOF still passes, because the read loop already consumes every complete line and only the final line reaches the EOF tail. Could you add a regression that fails on main (e.g. a chunking/\r\n case that really leaves several data: lines in the tail), or close this if the bug isn't reachable?

This branch has not been deployed

No deployments
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.

fix(antigravity): parse unterminated multi-line SSE events

2 participants