Skip to content

fix: parse Server-Sent Events in Agent Engine streaming responses - #7049

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara_959194089
Aug 12, 2026
Merged

fix: parse Server-Sent Events in Agent Engine streaming responses#7049
copybara-service[bot] merged 1 commit into
mainfrom
copybara_959194089

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: parse Server-Sent Events in Agent Engine streaming responses

Agent Engine streaming responses are newline-delimited JSON. A response may
instead arrive as Server-Sent Events, with each JSON object wrapped in a
data: frame. The streaming readers now remove that framing before parsing, so
both shapes yield the same parsed objects rather than raw data: {...}
strings, and the HttpBody reader parses a text/event-stream response rather
than yielding the unparsed message.

Newline-delimited JSON responses are unaffected.

@copybara-service
copybara-service Bot requested a review from a team as a code owner August 4, 2026 21:10
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Aug 4, 2026
@copybara-service
copybara-service Bot force-pushed the copybara_959194089 branch 4 times, most recently from 4a1f38a to dd91a61 Compare August 4, 2026 23:10
@copybara-service
copybara-service Bot force-pushed the copybara_959194089 branch 4 times, most recently from 0584d48 to 777786d Compare August 12, 2026 21:11
Agent Engine streaming responses are newline-delimited JSON. A response may
instead arrive as Server-Sent Events, with each JSON object wrapped in a
`data:` frame. The streaming readers now remove that framing before parsing, so
both shapes yield the same parsed objects rather than raw `data: {...}`
strings, and the `HttpBody` reader parses a `text/event-stream` response rather
than yielding the unparsed message.

Newline-delimited JSON responses are unaffected.

PiperOrigin-RevId: 963665494
@copybara-service
copybara-service Bot merged commit 7cb2fe9 into main Aug 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. google-contributor size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant