Dualmode#870
Conversation
Multi-mode means both the 1.0 and the 0.3 TCK server is provisioned with the 'other' protocol version to make sure having both does not interfere Needs temporary AgentCard producers for the 'other' version.
…patibility Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
There was a problem hiding this comment.
Code Review
This pull request introduces backward compatibility for v1.0 agent cards within the v0.3 client and updates the core AgentCard specification. Key changes include the addition of 'url' and 'preferredTransport' fields to the AgentCard record, an update to JSONRPCUtils to support ignoring unknown fields during parsing, and the introduction of 'multi-mode' build profiles in the TCK to facilitate cross-version testing. Feedback was provided regarding an inconsistency in the AgentCard record, where the 'preferredTransport' field was marked as nullable despite the builder providing a non-null default value; it is recommended to remove the @nullable annotation to clarify the API contract.
| @Nullable List<AgentCardSignature> signatures) { | ||
| @Nullable List<AgentCardSignature> signatures, | ||
| @Nullable String url, | ||
| @Nullable String preferredTransport) { |
There was a problem hiding this comment.
The preferredTransport field is annotated with @Nullable, but the Builder.build() method ensures it is never null by providing a default value (TransportProtocol.JSONRPC.name()). This inconsistency can be misleading and should be corrected to make the contract of AgentCard clear.
To enforce this non-null contract, the @Nullable annotation should be removed. You might also consider adding a null check in the compact constructor to ensure any direct instantiation of the record also respects this contract.
| @Nullable String preferredTransport) { | |
| String preferredTransport) { |
References
- Rely on class invariants established by constructors; avoid redundant null checks for fields that are guaranteed to be non-null by design.
Description
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.Fixes #<issue_number_goes_here> 🦕