Skip to content

Add RegistrySync SSE transport and resilience tests #2294

Description

@bokelley

Context

The registry is adding GET /api/registry/feed/stream as the Server-Sent Events transport for cursor-based registry feed pages. GET /api/registry/feed also now includes required freshness metadata.

Registry PR: adcontextprotocol/adcp#5733

SDK work

  • Regenerate/import registry OpenAPI types so FeedResponse includes freshness.
  • Add a stream client for /api/registry/feed/stream; generated OpenAPI types alone are not enough because the response is text/event-stream.
  • Update RegistrySync to default to auto: try SSE first, fall back to polling /api/registry/feed on unsupported transport, 404/406, proxy/network failure, or stream parse failure.
  • Persist cursor exactly as today; reconnect with last persisted cursor after disconnect.
  • On cursor_expired, re-bootstrap then resume.
  • Treat cursors as scoped to the same logical types subscription.
  • Persist data.cursor from SSE payload; registry does not use SSE id: / Last-Event-ID in 3.x.

Tests

  • Mock SSE server emits feed, heartbeat, disconnect, cursor_expired, and malformed data.
  • Cursor advances only on feed, not heartbeat.
  • Reconnect resumes from persisted cursor.
  • Stream errors and unsupported endpoint fall back to polling.
  • cursor_expired triggers re-bootstrap.
  • Duplicate or partial pages do not corrupt indexes.
  • Freshness metadata is exposed or observable for lag monitoring.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions