feat: implement TCK workflow and SUT for tests, adjust ci#517
feat: implement TCK workflow and SUT for tests, adjust ci#517JakubWorek wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors error mapping, content-type handling, and task lifecycle management to align with the A2A specification. Specifically, capability-gated rejections now map to UNIMPLEMENTED instead of FAILED_PRECONDITION, REST responses default to application/json, and content-type guards are introduced to reject unsupported media types. Additionally, the event bus is kept alive during interrupted task states (INPUT_REQUIRED and AUTH_REQUIRED) to support resubscription, and the TCK agent is updated to handle various test scenarios. Feedback on these changes highlights a potential memory leak in trackLatestTaskState where registered event listeners are never removed from the event bus when a task is interrupted, and suggests cleaning them up in the returned thunk.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
🧪 Code Coverage
Generated by coverage-comment.yml |
| if (error instanceof ContentTypeNotSupportedError) return HTTP_STATUS.BAD_REQUEST; | ||
| if (error instanceof ContentTypeNotSupportedError) return HTTP_STATUS.UNSUPPORTED_MEDIA_TYPE; |
There was a problem hiding this comment.
According to spec 5.4, ContentTypeNotSupportedError should map to 400 (Bad Request).
There was a problem hiding this comment.
These changes does not align with the spec 5.4.
Can you cite some TCK specification that requires such change? Or is there any other source of truth for that?
…EST requests, and update event loop termination logic for interrupted states, update ci pipelines for itk (#519) # Description This pull request introduces several important improvements to request handling, event streaming, and content type validation in the server codebase. The main focus is on correctly handling interrupted (non-terminal) task states, enforcing strict content type requirements for JSON-RPC and REST endpoints, and improving the robustness of server-sent event (SSE) streaming error handling. These changes enhance protocol compliance (especially with the A2A specification), prevent subtle bugs, and improve client-facing error reporting. **Task execution and event bus management:** - Introduced `INTERRUPTED_STATE_LIST` to distinguish non-terminal task states (such as `INPUT_REQUIRED` and `AUTH_REQUIRED`) that pause execution but keep the task and event bus alive for follow-up actions. The event bus is now only closed for truly terminal states, allowing clients to resubscribe or continue tasks as specified in the A2A protocol (§3.4.3). - Added a `trackLatestTaskState` utility to reliably track the most recent task state on the event bus, ensuring correct bus lifecycle management even when consumer processing lags behind event publishing. **Content type enforcement for API endpoints:** - Added middleware to strictly enforce `application/json` for JSON-RPC endpoints and either `application/json` or `application/a2a+json` for REST endpoints. Requests with unsupported content types now return a `ContentTypeNotSupportedError` mapped to HTTP 400, improving protocol compliance and error clarity. **Streaming and error handling improvements:** - Improved SSE streaming in JSON-RPC: the first event is now "peeked" before sending SSE headers, ensuring that errors occurring before the stream starts are returned as proper JSON-RPC error responses (with the correct HTTP status and format), rather than as misleading SSE error events. - Updated tests to assert that pre-stream errors result in JSON-RPC error responses instead of SSE error streams, aligning with the improved error handling logic. **Workflow trigger refinement:** - Updated GitHub workflow triggers to match all branches under `epic/**` rather than just `epic`, ensuring workflows run for all relevant feature branches. Part of changes from #517
Description
Replaces the experimental TCK SUT/workflow from bgralewicz/enable_tck_tests with a working setup across all three transports (JSON-RPC, REST/HTTP+JSON, gRPC) on a2a-tck 1.0.0.alpha2, and lands the SDK fixes that the conformance suite exposed.
TCK harness and its consequences:
Closes #491 🦕