Skip to content

Align discovery and transport code with updated proto schema#40

Open
MisterVVP wants to merge 1 commit into
dev-implement-ci-workflow-from-task-1-tckfrom
dev-perform-contract-fixes-and-tck-validation
Open

Align discovery and transport code with updated proto schema#40
MisterVVP wants to merge 1 commit into
dev-implement-ci-workflow-from-task-1-tckfrom
dev-perform-contract-fixes-and-tck-validation

Conversation

@MisterVVP
Copy link
Copy Markdown
Owner

Motivation

  • The protobuf schema changed from an enum-based transport to string protocol_binding and moved protocol_version to per-interface, so discovery/transport code must be updated to match the new contract.
  • REST/HTTP endpoints use an optional history_length int32 and security requirements were reshaped, requiring validation and parsing updates across client/server code and examples.

Description

  • Reworked discovery logic to consume protocol_binding and per-interface protocol_version, including IsValidInterfaceEndpoint, ToPreferredTransport, ToWireTransport, and validation helpers in src/client/discovery.cpp.
  • Updated REST server initialization to default per-interface protocol_version when missing in src/server/rest_server_transport.cpp and adjusted REST request parsing to parse historyLength as an integer (src/server/rest_transport.cpp).
  • Adjusted HTTP JSON client transport to treat history_length as an optional int32 and serialize it via std::to_string in src/client/http_json_transport.cpp.
  • Migrated examples, unit tests, and helpers to the new proto shapes (message Role enum usage and Part.text API, protocol binding strings, and security requirement map form) in examples/example_support.h and tests/unit/discovery_test.cpp.
  • Small API formatting and signature tidy-ups to keep headers and overrides consistent across client transports (include/a2a/client/*.h) and gRPC transport implementation formatting in src/client/grpc_transport.cpp.

Testing

  • Ran ./scripts/run_clang_format.sh which completed (formatting applied where needed) and then ran ./scripts/verify_changes.sh multiple times during the migration; the verification run aborted due to build/test compilation errors in integration tests.
  • Final ./scripts/verify_changes.sh run failed during the build stage with the following representative errors (excerpt):
/workspace/a2a-cpp/tests/integration/http_json_client_integration_test.cpp:50:39: error: cannot convert ‘const char [5]’ to ‘lf::a2a::v1::Role’
  request.mutable_message()->set_role("user");
                                          ^~~~~~
/workspace/a2a-cpp/tests/integration/http_json_client_integration_test.cpp:101:34: error: invalid conversion from ‘const char*’ to ‘int32_t’ {aka ‘int’} [-fpermissive]
  get_request.set_history_length("2");
                                 ^~~
/workspace/a2a-cpp/tests/integration/http_json_client_integration_test.cpp:168:15: error: ‘class lf::a2a::v1::TaskPushNotificationConfig’ has no member named ‘set_endpoint’
  set_request.set_endpoint("https://cb");
               ^~~~~~~~~~~~
...
gmake: *** [Makefile:146: all] Error 2
  • Because ./scripts/verify_changes.sh failed, full TCK validation was not executed; this PR is an in-progress migration that compiles most core and unit targets but leaves remaining integration tests and a few call sites to be updated to the new proto contract.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant