Skip to content

Add Extended Agent Card support: provider, dispatcher, transports, and serializer#126

Draft
MisterVVP wants to merge 21 commits into
mainfrom
dev-add-extendedagentcard-support
Draft

Add Extended Agent Card support: provider, dispatcher, transports, and serializer#126
MisterVVP wants to merge 21 commits into
mainfrom
dev-add-extendedagentcard-support

Conversation

@MisterVVP

Copy link
Copy Markdown
Owner

Motivation

  • Introduce support for an "extended agent card" that can be provided dynamically by the server and requested via protocol RPCs and HTTP/JSON-RPC endpoints.
  • Allow servers to declare support for an extended agent card in the agent card (WithExtendedAgentCard) while optionally configuring a provider that returns the full extended card.
  • Ensure transports (REST, gRPC, JSON-RPC) and dispatcher plumbing can route GetExtendedAgentCard requests and serialize normalized agent card JSON consistently, including legacy transport compatibility fields when requested.

Description

  • Added a provider abstraction core::AgentCardProvider and a simple core::StaticAgentCardProvider with GetExtendedAgentCard to supply configured extended cards via include/a2a/core/agent_card/agent_card_provider.h and src/core/agent_card/agent_card_provider.cpp.
  • Added AgentCardBuilder::WithExtendedAgentCard(bool) in include/a2a/core/agent_card/agent_card_builder.h and implementation in src/core/agent_card/agent_card_builder.cpp to mark capability in built cards.
  • Added a new protocol method constant core::protocol_methods::kGetExtendedAgentCard and extended dispatch_types/Dispatcher to support DispatcherOperation::kGetExtendedAgentCard and carry lf::a2a::v1::AgentCard in dispatch payloads.
  • Dispatcher now accepts an optional AgentCardProvider and will call it when handling kGetExtendedAgentCard; errors map to protocol error codes when no provider is configured.
  • Implemented agent card normalization/serialization helpers in server/agent_card/agent_card_serializer.* to produce normalized JSON and optionally add legacy transport fields.
  • Exposed an HTTP endpoint (/extendedAgentCard) via RestServerTransport::HandleExtendedAgentCard, and routed GetExtendedAgentCard through JSON-RPC (GetExtendedAgentCard method) and gRPC (GetExtendedAgentCard RPC) transports to the dispatcher.
  • Updated server code to add new source files to CMake (agent_card_provider, agent_card_serializer, moved agent card builder into agent_card/), and adjusted includes across examples/tests to the new a2a/core/agent_card/ path.
  • Updated/added unit and integration tests to cover configured and not-configured scenarios and required-extension validation for extended agent card handling (tests/unit/*, tests/integration/grpc_transport_integration_test.cpp, tests/interop/tck_http_sut.cpp).

Testing

  • Ran unit tests including AgentCardBuilderTest, GrpcServerTransportTest, JsonRpcServerTransportTest, RestServerTransportTest, and ServerDispatcherTest, which were updated to cover configured and missing provider scenarios; all unit tests passed.
  • Executed the gRPC transport integration test (tests/integration/grpc_transport_integration_test.cpp) after wiring the StaticAgentCardProvider; the integration test passed.
  • Exercised the TCK SUT example (tests/interop/tck_http_sut.cpp) with the new extended-card configuration flags; the updated interop test scenarios ran successfully.

Codex Task

@MisterVVP MisterVVP linked an issue Jun 29, 2026 that may be closed by this pull request
@MisterVVP MisterVVP marked this pull request as draft June 29, 2026 21:28
@MisterVVP MisterVVP self-assigned this Jun 29, 2026
@MisterVVP

Copy link
Copy Markdown
Owner Author

More refactoring to be added before reviewing this

@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/rest_server_transport.cpp Outdated
Comment thread src/server/dispatcher.cpp Outdated
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/rest_server_transport.cpp
Comment thread src/server/json_rpc_server_transport.cpp Outdated
Comment thread src/server/rest_server_transport.cpp Outdated
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/transport_mux.cpp Outdated
Comment thread src/server/rest_server_transport.cpp
MisterVVP and others added 3 commits July 1, 2026 10:52
### 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)
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/json_rpc_server_transport.cpp
Comment thread include/a2a/core/core.h
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server/json_rpc_server_transport.cpp
MisterVVP

This comment was marked as spam.

@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +424 to +425
return DispatchRequest{.operation = DispatcherOperation::kGetExtendedAgentCard,
.payload = std::move(payload.value())};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

[Feature]: Extended Agent Card support

1 participant