feat: defined compat-specific consts and mappings#478
Conversation
🧪 Code Coverage
Generated by coverage-comment.yml |
There was a problem hiding this comment.
Code Review
This pull request introduces a compatibility layer for the legacy A2A v0.3 protocol, including constants and bi-directional method mappings between legacy JSON-RPC, legacy gRPC, and v1.0. It also adds comprehensive unit tests to verify these mappings. The reviewer recommended updating the lookup utility to use the standard JSON-RPC 'Method not found' error code (-32601) and suggested using hasOwnProperty to prevent potential issues with prototype properties during method lookups.
There was a problem hiding this comment.
Code Review
This pull request introduces a compatibility layer for the legacy A2A v0.3 protocol, including method name mappings between legacy JSON-RPC, legacy gRPC, and v1.0. It also adds a suite of unit tests to ensure mapping accuracy and bidirectional consistency. Feedback was provided to improve the robustness of the method lookup logic by using hasOwnProperty to avoid potential prototype pollution or unexpected behavior from untrusted input keys.
bartek-gralewicz
left a comment
There was a problem hiding this comment.
At some point, we'll probably need some simple REST mapping as well (dropped /v1 prefix in the endpoint). For now, this looks like a good base.
Description
Defined compat layer specific constants (eg
LEGACY_HTTP_EXTENSION_HEADER).Created mappings between v0.3 and v1.0 method names and helper methods for translating them.
Closes #472 🦕