fix(a2a): reformat SseEventFormatter output to JSON-RPC 2.0 notification structure #1841

Merged
freemo merged 1 commits from fix/a2a-sse-event-formatter-jsonrpc2-compliance into master 2026-04-03 01:07:54 +00:00

1 Commits

Author SHA1 Message Date
freemo 288ff276b3 fix(a2a): reformat SseEventFormatter output to JSON-RPC 2.0 notification structure
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Failing after 23s
CI / helm (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 34s
CI / security (pull_request) Failing after 47s
CI / typecheck (pull_request) Failing after 50s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m47s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Failing after 13m17s
CI / integration_tests (pull_request) Failing after 21m52s
CI / status-check (pull_request) Failing after 1s
- Add _EVENT_TYPE_TO_METHOD class-level mapping (ClassVar[dict[str, str]]) to
  convert A2A event types to JSON-RPC 2.0 method names:
  TaskStatusUpdateEvent → task/statusUpdate
  TaskArtifactUpdateEvent → task/artifactUpdate
- Refactor SseEventFormatter.format() to produce JSON-RPC 2.0 notification
  envelope: {"jsonrpc": "2.0", "method": "...", "params": {...}}
- Move event data fields into params object; include taskId (from plan_id)
  in params when plan_id is present, per spec §Streaming Architecture
- Remove non-spec fields (event_id, event_type, timestamp, plan_id) from
  the data payload; these remain in SSE envelope headers (event: and id:)
- Update BDD feature to verify JSON-RPC 2.0 structure for both event types,
  events with/without plan_id, custom data in params, and exclusion of
  non-spec fields
- Fix pre-existing type errors in step definitions: replace try/except
  ImportError pattern with direct imports and use behave.runner.Context
  for proper static typing (0 pyright errors)

ISSUES CLOSED: #1502
2026-04-02 23:53:13 +00:00