Skip to content

v0.4.0: SSE reconnection and connection health monitoring#10

Merged
vsima merged 1 commit intomainfrom
claude/affectionate-black
Mar 16, 2026
Merged

v0.4.0: SSE reconnection and connection health monitoring#10
vsima merged 1 commit intomainfrom
claude/affectionate-black

Conversation

@vsima
Copy link
Copy Markdown
Member

@vsima vsima commented Mar 16, 2026

Summary

  • SSE reconnection with configurable retry, exponential backoff + jitter (SSEConfiguration), Last-Event-ID on reconnect, and event deduplication
  • Connection health monitoring via ConnectionState enum and StreamingSession type with new sendStreamingMessageWithSession / subscribeToTaskWithSession methods
  • Server-side SSE enhancementwrapStreamAsSSE now emits id: and retry: fields per SSE spec
  • SSELineParser — internal parser for proper SSE field handling (data:, id:, retry:, event:)
  • All existing streaming methods unchanged (non-breaking)

New Files

File Purpose
Sources/A2A/Client/SSEConfiguration.swift Reconnection config with backoff + jitter
Sources/A2A/Client/SSELineParser.swift Internal SSE field parser
Sources/A2A/Client/ConnectionState.swift Connection state enum
Sources/A2A/Client/StreamingSession.swift Rich streaming return type

Test plan

  • SSELineParser — 14 tests covering all field types, state tracking, edge cases
  • SSEConfiguration — 6 tests covering defaults, backoff math, clamping, jitter range
  • SSE streaming format — 4 tests verifying id:/retry: emission, JSON-RPC validity, double-newline termination
  • StreamingSession structure test
  • All 97 tests pass (up from 73)
  • CI: macOS + Linux

🤖 Generated with Claude Code

…sion API for v0.4.0

Adds production-grade streaming resilience to the A2A client with automatic
SSE reconnection using exponential backoff, proper SSE field parsing, and
connection health monitoring via StreamingSession.

New types: SSEConfiguration, SSELineParser, ConnectionState, StreamingSession
New methods: sendStreamingMessageWithSession, subscribeToTaskWithSession
Server: wrapStreamAsSSE now emits id: and retry: fields per SSE spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vsima vsima merged commit bc3b4bb into main Mar 16, 2026
5 checks passed
@vsima vsima deleted the claude/affectionate-black branch March 16, 2026 14:51
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.

1 participant