feat: expose HTTP response headers in A2AHttpResponse and A2AClientHT…#922
feat: expose HTTP response headers in A2AHttpResponse and A2AClientHT…#922kabir wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a read-only abstraction for HTTP response headers (A2AHttpHeaders) and propagates these headers through HTTP clients, JSON-RPC transport, and REST error mappers into A2AClientHTTPError. This allows callers to inspect critical headers like Retry-After on rate-limited responses. Feedback highlights two key improvements: adding defensive null checks in the Android HTTP client to prevent a potential NullPointerException when parsing connection headers, and copying headers into a case-insensitive map within A2AClientHTTPError to preserve RFC 7230 case-insensitivity compliance.
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.
…TPError Add A2AHttpHeaders interface as a transport-independent abstraction over HTTP response headers, with implementations for JDK, Vert.x, and Android HTTP clients. Headers are also propagated into A2AClientHTTPError so callers can access headers like Retry-After (429) and WWW-Authenticate (401) from error responses. This fixes a2aproject#920 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a read-only abstraction over HTTP response headers (A2AHttpHeaders) and integrates it across various HTTP client implementations (Android, Vert.x, JDK) and error mapping utilities, enabling callers to inspect headers like Retry-After during error handling. The feedback highlights several potential NullPointerException risks, specifically when handling null header names in the case-insensitive TreeMap and JDK/Vert.x implementations, as well as when copying header lists that might contain null elements.
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.
…TPError
Add A2AHttpHeaders interface as a transport-independent abstraction over HTTP response headers, with implementations for JDK, Vert.x, and Android HTTP clients. Headers are also propagated into A2AClientHTTPError so callers can access headers like Retry-After (429) and WWW-Authenticate (401) from error responses.
This fixes #920