Repository navigation
Conversation
5353b19 to
d87ca59
Compare
kabir
left a comment
There was a problem hiding this comment.
Hi @dangzitou - thank you for the PR!
One small issue:
The fallback switch in GrpcErrorMapper.java (line 77) still maps UNIMPLEMENTED to UnsupportedOperationError. Since the server now sends FAILED_PRECONDITION for this error, this fallback won't match when ErrorInfo details are absent. Consider adding a
FAILED_PRECONDITION case alongside the existing UNIMPLEMENTED one (since UNIMPLEMENTED is still used by other error types like PushNotificationNotSupportedError).
The primary ErrorInfo-based path (lines 62-70) handles this correctly via the reason field, so this only affects the fallback.
Signed-off-by: Dang Zitou <[email protected]>
4b28625 to
2d1a7cb
Compare
|
Addressed the requested fallback mapping in 2d1a7cb: |
|
Hi, @dangzitou sorry for not noticing this earlier but after looking a bit more carefully I noticed this isn't quite right. The current SDK targets v1.0.0, which is still the latest released version on the official A2A spec site (https://a2a-protocol.org/latest/specification/). (source at https://github.com/a2aproject/A2A/blob/v1.0.0/docs/specification.md#54-error-code-mappings). The v1.0.0 spec maps UnsupportedOperationError to UNIMPLEMENTED, so I think the existing code is correct. The FAILED_PRECONDITION mapping comes from v1.0.1 (tagged on GitHub but not yet reflected on the official site). We haven't decided whether to adopt v1.0.1 yet, and if we do, the error mapping table has 6 changes between the two versions — not just this one — so we'd want to handle them together. I was investigating whether we could support both 1.0.0 and 1.0.1 of the protocol but both seem to use
Since https://a2a-protocol.org/latest/specification/ still points to 1.0.0 I think we need to go with what we have. Thank you for your work, but we will close this for now. |
Description
Align
UnsupportedOperationErrorwith the A2A gRPC specification by mapping it toFAILED_PRECONDITIONinstead ofUNIMPLEMENTED. Update the existing server and client mapping assertions, plus the handler mapping documentation.CONTRIBUTINGGuide.Reproduction
On current
main, changing only the eight existingGrpcHandlerTestexpectations for paths that emitUnsupportedOperationErrorproduced 8 consistent failures out of 42 tests:Verification
Run with OpenJDK 17:
Results:
transport/grpc: 42 tests passedclient/transport/grpc: 9 tests passedA root
mvn clean installwas also attempted, but the unrelatedclient/transport/jsonrpctests could not bind/use their hard-coded local endpoint because127.0.0.1:4001was already occupied by another local application. The two changed gRPC modules were fully tested separately above.This fixes #1051