Skip to content

[http-client-python] Add SSE reconnection #11761

Description

Structured SSE streams generated by @typespec/http-client-python parse and expose stream.last_event_id and stream.retry, and operations accept last_event_id= to send Last-Event-ID for manual resume. They intentionally do not automatically reconnect after an unexpected EOF.

Add automatic SSE reconnection once the behavior is available in the azure-core streaming/transport layer rather than implementing a generator-vendored reconnect loop. The integration should:

  • Reconnect after unexpected EOF using the SSE default delay, overridden by valid retry: fields.
  • Send the latest event ID through Last-Event-ID.
  • Stop reconnecting after terminal events and HTTP 204 responses.
  • Preserve normal 301/307 redirect handling through the pipeline.
  • Support sync and async streams.
  • Fix the Streaming_Sse_Protocol_reconnect Spector scenario.

Related Spector coverage issue: #11572.

Metadata

Metadata

Labels

emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonfeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions