ClientBuilder has no fallback to AgentCard#additionalInterfaces()/preferredTransport() (legacy 0.3 cards) when supportedInterfaces() is absent
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
SDK の ClientBuilder#getServerInterfacesMap() を確認してください。問題は、これが agentCard.supportedInterfaces() からしか読み取らず、空の場合に例外をスローし、レガシーの additionalInterfaces() と preferredTransport() を無視していることです。Legacy_0_3_AgentInterface オブジェクトを AgentInterface に変換するフォールバックを追加する必要があります。まず AgentCard クラスを調べてフィールドを理解し、その後、レガシーケースを処理するようにメソッドを変更してください。0.3 スタイルのカードを作成し、クライアントが正常に構築されることを確認してテストしてください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
ClientBuilder#getServerInterfacesMap() builds its list of candidate transports from AgentCard#supportedInterfaces() only:
private Map<String, AgentInterface> getServerInterfacesMap() throws A2AClientException {
List<AgentInterface> interfaces = agentCard.supportedInterfaces();
if (interfaces == null || interfaces.isEmpty()) {
throw new A2AClientException("No server interface available in the AgentCard");
}
...
}
If an AgentCard was produced by an A2A "0.3" server (e.g. anything built on io.a2a.spec.AgentCard from io.github.a2asdk:a2a-java-sdk-reference-jsonrpc, which only has additionalInterfaces/preferredTransport, not supportedInterfaces), Client.builder(agentCard) / ClientBuilder#build() always throws A2AClientException: No server interface available in the AgentCard, even though AgentCard itself models exactly this legacy shape via additionalInterfaces():
private final List<AgentInterface> supportedInterfaces;
private final List<Legacy_0_3_AgentInterface> additionalInterfaces;
...
public List<AgentInterface> supportedInterfaces();
public List<Legacy_0_3_AgentInterface> additionalInterfaces();
Since Legacy_0_3_AgentInterface exists specifically to deserialize the older additionalInterfaces/preferredTransport shape, I'd expect ClientBuilder to fall back to it (converting each Legacy_0_3_AgentInterface + the card's preferredTransport into an AgentInterface) when supportedInterfaces is absent, so that clients built against the current SDK can still talk to agents that only publish a 0.3-style card.
How to reproduce
- Stand up any A2A server that only serves a 0.3-style card, e.g.:
(this is exactly what{ "name": "Summarizer Agent", "url": "http://localhost:10010", "version": "1.0.0", "capabilities": {"streaming": false, "pushNotifications": false, "stateTransitionHistory": false}, "defaultInputModes": ["text"], "defaultOutputModes": ["text"], "skills": [...], "additionalInterfaces": [{"transport": "JSONRPC", "url": "http://localhost:10010"}], "preferredTransport": "JSONRPC", "protocolVersion": "0.3.0" }io.a2a.spec.AgentCard.Builderfroma2a-java-sdk-reference-jsonrpc0.3.0.Beta1/0.3.2.Final produces — there's nosupportedInterfaces()builder method on that class at all, so no 0.3-based server can add it) AgentCard card = A2A.getAgentCard("http://localhost:10010");Client.builder(card).withTransport(JSONRPCTransport.class, new JSONRPCTransportConfigBuilder()).build();- Observe
A2AClientException: No server interface available in the AgentCard, even though the server is reachable and does support JSON-RPC.
I confirmed via a minimal Jackson round-trip that a supportedInterfaces entry must use the field name protocolBinding (not transport) to deserialize into AgentInterface, and that capabilities.stateTransitionHistory (present on all 0.3-style cards) is silently ignored rather than rejected — so the parsing itself is otherwise lenient, it's specifically this transport-selection step that has no legacy fallback.
Expected behavior
ClientBuilder should be able to build a working client against an agent that only publishes a 0.3-style card (additionalInterfaces + preferredTransport), by falling back to AgentCard#additionalInterfaces() (converting Legacy_0_3_AgentInterface → AgentInterface, using preferredTransport() to pick the client's preferred one) when supportedInterfaces() is null/empty.
Context
Found this while wiring up langchain4j-agentic-a2a's AgenticServices.a2aBuilder(url) (used by quarkus-langchain4j-a2a-apicurio-registry's ApicurioAgentsRegistry) against real A2A agents built with a2a-java-sdk-reference-jsonrpc 0.3.0.Beta1/0.3.2.Final for a demo project (https://github.com/carlesarnal/agent-discovery-demo). As things stand, no agent built on the "0.3" reference server can be reached by any client built on the current org.a2aproject.sdk Client/ClientBuilder, regardless of how the client obtains the AgentCard.
- 主要言語
- Java
- スター
- 500
- フォーク
- 179
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 48
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
a2aproject/a2a-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
a2aproject/a2a-java#1012 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
a2aproject/a2a-java#464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Create a sample that demonstrates how to use a shared contextId across multiple tasks再び着手できるかも @tanish111 が 343 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンsample
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
a2aproject/a2a-java#375 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
a2aproject/a2a-java#1161 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
a2aproject/a2a-java#1132 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
a2aproject/a2a-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
go 🏃 testing 🧪
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7239 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/copilot-sdk#2793 ·
メンテナーはふだん 1 日以内に返信