Add Extended Agent Card support: provider, dispatcher, transports, and serializer#126
Add Extended Agent Card support: provider, dispatcher, transports, and serializer#126MisterVVP wants to merge 21 commits into
Conversation
|
More refactoring to be added before reviewing this |
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2308715618
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d0489bb18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4ec4c2b61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### Motivation - Reduce duplicated HTTP method and protocol path literals (e.g. `"GET"`, `"/extendedAgentCard"`) and centralize them as a single source of truth. - Prefer header declarations for protocol/transport constants so clients and server components use the same canonical values and avoid drift. ### Description - Added `a2a::core::protocol_paths` header with `kAgentCard`, `kLegacyAgentCard`, `kExtendedAgentCard`, and `kWellKnownPrefix` constants and used it across discovery and server routing. - Introduced `kMethodDelete` into `a2a::core::http` and replaced scattered literal method strings with `core::http::kMethodGet`, `kMethodPost`, and `kMethodDelete` in clients, transports, and push delivery code. - Updated `RestServerTransport` public path aliases to reference the new core protocol path constants and adjusted `TransportMux`, `RestTransport`, `HttpJsonTransport`, `JsonRpcTransport`, and push-delivery code to use shared constants. - Applied a small test-only API fix by adding `[[nodiscard]]` to test agent-card provider overrides to satisfy static analysis. ### Testing - Ran formatting checks via `./scripts/run_clang_format.sh` and `clang-format --dry-run --Werror` which completed successfully. - Ran the repository validation via `./scripts/verify_changes.sh` which performed configure/build/`ctest` and `clang-tidy` and completed with all checks passing. - All automated tests (unit, functional, and integration) executed under `ctest` and reported `100%` passed. - Attempted the local TCK flow with `./scripts/run_tck_sut.sh && ./scripts/run_tck_mandatory.sh` but the local TCK runner reported no supported mandatory entrypoint in the checked-out tck repo (SUT started/stopped successfully), so the mandatory-suite could not be executed locally. ------ [Codex Task](https://chatgpt.com/codex/cloud/tasks/task_e_6a44d8d923a48333b1d7d0fb00edb563)
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 577370584d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 408109d3ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 408109d3ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return DispatchRequest{.operation = DispatcherOperation::kGetExtendedAgentCard, | ||
| .payload = std::move(payload.value())}; |
There was a problem hiding this comment.
Return the extended-card ErrorInfo reason
When this new JSON-RPC method is dispatched without an AgentCardProvider, the dispatcher returns protocol code -32007, but BuildErrorResponse still gets its ErrorInfo reason from ErrorInfoReason, which has no kExtendedAgentCardNotConfigured branch. JSON-RPC clients therefore see protocolCode: -32007 with reason UNSUPPORTED_OPERATION, unlike the REST and gRPC paths added in this change; add the missing mapping so the error metadata is consistent.
Useful? React with 👍 / 👎.
Motivation
WithExtendedAgentCard) while optionally configuring a provider that returns the full extended card.GetExtendedAgentCardrequests and serialize normalized agent card JSON consistently, including legacy transport compatibility fields when requested.Description
core::AgentCardProviderand a simplecore::StaticAgentCardProviderwithGetExtendedAgentCardto supply configured extended cards viainclude/a2a/core/agent_card/agent_card_provider.handsrc/core/agent_card/agent_card_provider.cpp.AgentCardBuilder::WithExtendedAgentCard(bool)ininclude/a2a/core/agent_card/agent_card_builder.hand implementation insrc/core/agent_card/agent_card_builder.cppto mark capability in built cards.core::protocol_methods::kGetExtendedAgentCardand extendeddispatch_types/Dispatcherto supportDispatcherOperation::kGetExtendedAgentCardand carrylf::a2a::v1::AgentCardin dispatch payloads.AgentCardProviderand will call it when handlingkGetExtendedAgentCard; errors map to protocol error codes when no provider is configured.server/agent_card/agent_card_serializer.*to produce normalized JSON and optionally add legacy transport fields./extendedAgentCard) viaRestServerTransport::HandleExtendedAgentCard, and routedGetExtendedAgentCardthrough JSON-RPC (GetExtendedAgentCardmethod) and gRPC (GetExtendedAgentCardRPC) transports to the dispatcher.agent_card_provider,agent_card_serializer, moved agent card builder intoagent_card/), and adjusted includes across examples/tests to the newa2a/core/agent_card/path.tests/unit/*,tests/integration/grpc_transport_integration_test.cpp,tests/interop/tck_http_sut.cpp).Testing
AgentCardBuilderTest,GrpcServerTransportTest,JsonRpcServerTransportTest,RestServerTransportTest, andServerDispatcherTest, which were updated to cover configured and missing provider scenarios; all unit tests passed.tests/integration/grpc_transport_integration_test.cpp) after wiring theStaticAgentCardProvider; the integration test passed.tests/interop/tck_http_sut.cpp) with the new extended-card configuration flags; the updated interop test scenarios ran successfully.Codex Task