ClientBuilder has no fallback to AgentCard#additionalInterfaces()/preferredTransport() (legacy 0.3 cards) when supportedInterfaces() is absent
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
Línea de trabajo
Examine ClientBuilder#getServerInterfacesMap() en el SDK. El problema es que solo lee de agentCard.supportedInterfaces() y lanza una excepción si está vacío, ignorando additionalInterfaces() y preferredTransport() heredados. Debe añadir un fallback que convierta los objetos Legacy_0_3_AgentInterface en AgentInterface. Empiece examinando la clase AgentCard para entender los campos y, después, modifique el método para gestionar el caso heredado. Pruebe creando una tarjeta de estilo 0.3 y verificando que el cliente se construye correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 504
- Forks
- 184
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 31
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de a2aproject/a2a-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
a2aproject/a2a-java#1012 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
a2aproject/a2a-java#464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Create a sample that demonstrates how to use a shared contextId across multiple tasksQuizá libre de nuevo @tanish111 la tomó hace 354 días y no hay ningún pull request abierto. Abiertosample
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
a2aproject/a2a-java#375 · 5 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
a2aproject/a2a-java#1207 ·
Los mantenedores suelen responder en 1 día
-
Enable checkstyle failOnViolation=truePosiblemente ocupada @ZYZ666-RGB la tomó hace 3 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
a2aproject/a2a-java#1206 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de a2aproject/a2a-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
utopia-rise/godot-jvm#1004 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
spring-projects/spring-grpc#442 ·
-
Expose numberOfPermits in RateLimiterEvent.toString() and the ratelimiterevents actuator DTOAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
resilience4j/resilience4j#2547 ·
Los mantenedores suelen responder en 9 días
-
Clock.MakeDate continues execution and returns a rolled-over instant after dispatching error on invalid datePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
mit-cml/appinventor-sources#4155 ·
Los mantenedores suelen responder en 1 día
-
[Doc] - Creation du READMEAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
Hira-shi/PW1-DAI-Carrel-Egal-Eyer#28 ·
Los mantenedores suelen responder en 1 día