feat(a2a): implement SSE streaming for task updates and artifacts #1048

Merged
freemo merged 1 commits from feature/m6-a2a-sse-streaming into master 2026-03-22 01:24:58 +00:00

1 Commits

Author SHA1 Message Date
freemo f138bab5ff feat(a2a): implement SSE streaming for task updates and artifacts
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 3m38s
CI / quality (pull_request) Successful in 4m5s
CI / typecheck (pull_request) Successful in 4m21s
CI / security (pull_request) Successful in 4m31s
CI / e2e_tests (pull_request) Successful in 8m45s
CI / integration_tests (pull_request) Successful in 9m5s
CI / unit_tests (pull_request) Successful in 9m9s
CI / docker (pull_request) Successful in 1m9s
CI / coverage (pull_request) Successful in 10m46s
CI / status-check (pull_request) Successful in 2s
CI / lint (push) Successful in 3m18s
CI / build (push) Successful in 22s
CI / quality (push) Successful in 3m39s
CI / security (push) Successful in 4m0s
CI / typecheck (push) Successful in 4m12s
CI / benchmark-regression (push) Has been skipped
CI / e2e_tests (push) Successful in 8m20s
CI / integration_tests (push) Successful in 8m38s
CI / unit_tests (push) Successful in 8m42s
CI / docker (push) Successful in 1m13s
CI / coverage (push) Successful in 10m49s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 29m24s
CI / benchmark-regression (pull_request) Successful in 51m28s
Add Server-Sent Events (SSE) streaming infrastructure to the A2A
event system, enabling real-time delivery of task status updates
and artifact notifications.

Key changes:
- Defined SSE event type constants: TASK_STATUS_UPDATE
  (TaskStatusUpdateEvent) and TASK_ARTIFACT_UPDATE
  (TaskArtifactUpdateEvent) per the A2A protocol specification.
- Added SseEventFormatter class that converts A2aEvent instances
  to text/event-stream format with event, id, and data fields.
  Includes keepalive formatting for long-lived connections.
- Added EventBusBridge class that subscribes to the internal
  EventBus (ReactiveEventBus) and translates DomainEvent instances
  into A2aEvent instances published to the A2aEventQueue. Maps
  plan lifecycle events (PLAN_CREATED, PLAN_PHASE_CHANGED, etc.)
  to TaskStatusUpdateEvent and checkpoint events to
  TaskArtifactUpdateEvent.
- Bridge handles closed queue gracefully via contextlib.suppress.
- Added 8 Behave scenarios covering SSE formatting, event type
  constants, EventBusBridge translation for both status and
  artifact events, closed queue handling, and JSON payload
  validation.

ISSUES CLOSED: #875
2026-03-22 01:07:20 +00:00