[Bug]: SDK ships no native-image reachability metadata, breaking GraalVM builds
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Calme
- Domaine
- backend, build-system, devtools
Piste de recherche
Le problème concerne l’absence de métadonnées GraalVM native-image dans le SDK. Recherchez les répertoires META-INF/native-image/ et les annotations @RegisterForReflection dans le codebase. Le rapporteur liste six bloqueurs précis ; commencez par examiner les classes et les packages mentionnés (par exemple, org.a2aproject.sdk.spec.util.ErrorDetail, org.a2aproject.sdk.grpc.SendMessageRequest, com.google.protobuf.Struct, META-INF/a2a-defaults.properties). Vérifiez les modules de référence Quarkus pour MainEventBusProcessorInitializer et son observer. La correction consiste à créer des fichiers de métadonnées de reachability et éventuellement à modifier un observer pour utiliser StartupEvent. Les tests nécessitent de construire une image native avec le SDK.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happened?
I hit six distinct blockers building a GraalVM native image of an application that uses the SDK's Quarkus reference server. Each one was only visible after the previous had been fixed, and none of them produced a useful error message at runtime: the application answers HTTP 500 and logs nothing.
Context: I am building an A2A server extension for Quarkus LangChain4j, which exposes a LangChain4j AI service as an A2A agent. It started from a stalled PR by another contributor, who is not involved in this work; that PR predates the 1.x SDK, and most of the current code is my own, bringing it to 1.2.0.Final and to GraalVM native image, which is a first-class target for Quarkus applications. The goal is to land the extension in quarkus-langchain4j proper, so this SDK would ship inside a released Quarkus extension.
| # | Symptom | Root cause | My workaround |
|---|---|---|---|
| 1 | Detected a started Thread in the image heap. Thread name: MainEventBusProcessor |
MainEventBusProcessorInitializer observes @Initialized(ApplicationScoped.class), which Quarkus fires during static initialization |
veto the initializer, start the processor on StartupEvent instead |
| 2 | AgentCard specifies transport interfaces for unavailable transports: [JSONRPC]. Available transports: [] |
transports are discovered with ServiceLoader, and Quarkus builds native images with -H:-UseServiceLoaderFeature |
register the providers at build time |
| 3 | every error response becomes HTTP 500 | Gson reflects over ErrorDetail |
register the spec packages for reflection |
| 4 | Generated message class "org.a2aproject.sdk.grpc.SendMessageRequest" missing method "getTenant" |
protobuf reflects over the generated messages when parsing a request | register the generated messages for reflection |
| 5 | Generated message class "com.google.protobuf.Struct" missing method "newBuilder" |
the generated messages are built out of protobuf's own well-known types | register com.google.protobuf too |
| 6 | No default configuration value found for: a2a.blocking.agent.timeout.seconds |
META-INF/a2a-defaults.properties is not included in the image |
register the resource |
Worth noting for #4: this one is not gRPC-specific. I initially assumed a request is only parsed into a protobuf message when gRPC is the transport serving it, and made the registration conditional on gRPC being present. That broke every JSON-RPC-only native image, because the JSON-RPC path converts to protobuf internally as well.
The request
Would you consider shipping native-image reachability metadata (reachability-metadata.json, or reflect-config.json + resource-config.json) in the SDK jars? That would fix #3–#6 for every consumer, not just Quarkus ones, since GraalVM picks the metadata up automatically from META-INF/native-image/.
Blockers #1 and #2 are Quarkus-specific, but the SDK ships Quarkus reference modules, so they arguably belong to it too. For #1 in particular: starting a thread from an @Initialized(ApplicationScoped.class) observer is questionable in any mode, not only native. Quarkus fires that event during static init, which is the one place a live thread must not be created. Observing StartupEvent instead would be a one-line change.
Why consumer-side registration is fragile: a concrete case from this week
Because consumers have to name the SDK's packages themselves, the metadata silently drifts out of sync with the SDK.
Upgrading my extension from 1.1.0.Final to 1.2.0.Final, #987 (refactor!: resolve all split packages) moved ErrorDetail:
org.a2aproject.sdk.util → org.a2aproject.sdk.spec.util
My reflection registration still named the old package, which no longer exists, so blocker #3 came straight back: every error response returned HTTP 500 again. All 41 of my JVM unit tests passed against 1.2.0. The failure only appeared in the native integration tests, and only on the two tests that assert an error response. Had the metadata lived in the SDK jars, it would have moved along with the class and nobody downstream would have noticed.
Verified against 1.2.0.Final
There is no reachability-metadata.json, reflect-config.json, native-image.properties, @RegisterForReflection or GraalVM substitution anywhere under src/main in the repository, and blockers #1, #2 and #6 still reproduce as described. MainEventBusProcessorInitializer still observes @Initialized(ApplicationScoped.class).
I would be glad to prepare a PR for the metadata, and separately for the StartupEvent change, if you agree with the direction, though I would rather confirm the shape you prefer before writing it.
Relevant log output
# 1: build time
Error: Detected a started Thread in the image heap. Thread name: MainEventBusProcessor
# 2: startup
java.lang.IllegalStateException: AgentCard specifies transport interfaces for unavailable
transports: [JSONRPC]. Available transports: []
# 4: request time, HTTP 500
Invalid request content: Generated message class
"org.a2aproject.sdk.grpc.SendMessageRequest" missing method "getTenant"
# 5: request time, HTTP 500
Generated message class "com.google.protobuf.Struct" missing method "newBuilder"
# 6: startup
java.util.NoSuchElementException: No default configuration value found for:
a2a.blocking.agent.timeout.seconds
Environment
- a2a-java
1.2.0.Final(originally found on1.1.0.Final) - Quarkus 3.33.2, Mandrel 25.0.2
Code of Conduct
- I agree to follow this project's Code of Conduct
- Langage dominant
- Java
- Étoiles
- 507
- Forks
- 192
- Merge moyen
- 3 j 8 h
- PR mergées (30 j)
- 23
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
-
fix: handle blank push notification config id consistently across transportsPeut-être pris @prachisinghal-1 l’a pris il y a 6 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
a2aproject/a2a-java#1012 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
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 2 jours
-
Create a sample that demonstrates how to use a shared contextId across multiple tasksPeut-être à nouveau libre @tanish111 l’a pris il y a 373 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 2 jours
-
Task state transitions are not trackedPeut-être à nouveau libre @sumitvairagar l’a pris il y a 12 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
a2aproject/a2a-java#1222 · 4 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
No structured payload loggingPeut-être pris @katepallewarprathmesh-sketch l’a pris il y a 10 jours. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 18/100
a2aproject/a2a-java#1221 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de a2aproject/a2a-java
Issues similaires
-
Update samples to Citrus 5.1.0Peut-être pris @asuruceanu l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
snowflakedb/snowflake-kafka-connector#1610 ·
Les mainteneurs répondent en général sous 1 jour
-
add multipart/form-data exampleOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
swagger-api/swagger-petstore#245 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
liquid-java/liquidjava#443 ·
Les mainteneurs répondent en général sous 2 jours