ClientBuilder has no fallback to AgentCard#additionalInterfaces()/preferredTransport() (legacy 0.3 cards) when supportedInterfaces() is absent
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 65/100
Piste de recherche
Examinez ClientBuilder#getServerInterfacesMap() dans le SDK. Le problème est qu'il ne lit que agentCard.supportedInterfaces() et lève une exception si celui-ci est vide, en ignorant additionalInterfaces() et preferredTransport() hérités. Vous devez ajouter un fallback qui convertit les objets Legacy_0_3_AgentInterface en AgentInterface. Commencez par examiner la classe AgentCard pour comprendre les champs, puis modifiez la méthode afin qu'elle gère le cas legacy. Testez en créant une carte de style 0.3 et en vérifiant que le client est construit avec succès.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 500
- Forks
- 179
- Merge moyen
- 1 j 16 h
- PR mergées (30 j)
- 48
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de a2aproject/a2a-java
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
a2aproject/a2a-java#1012 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
a2aproject/a2a-java#464 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Create a sample that demonstrates how to use a shared contextId across multiple tasksPeut-être à nouveau libre @tanish111 l’a pris il y a 344 jours, et aucune pull request n’est ouverte. Ouvertesample
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
a2aproject/a2a-java#375 · 5 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
a2aproject/a2a-java#1161 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
a2aproject/a2a-java#1132 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de a2aproject/a2a-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
beehive-lab/TornadoVM#1151 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
(cbor) `maxStringLength` not consistently checked for chunked (indefinite-length) text valuesOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
FasterXML/jackson-dataformats-binary#823 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour