You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: A2aAgent throws an SDK NullPointerException when AgentCardResolver cannot find the agent #3596
java.lang.IllegalStateException: No AgentCard found for A2A agent 'remote-agent' via NacosAgentCardResolver. Check that the agent name matches the name registered on the server.
SDK 内部的空指针不再暴露给用户。
报错信息
main(c416c378e,a2a-java-sdk 0.3.3.Final):
java.lang.NullPointerException: Cannot invoke "io.a2a.spec.AgentCard.preferredTransport()" because "this.agentCard" is null
at io.a2a.client.ClientBuilder.getServerPreferredTransports(ClientBuilder.java:113)
at io.a2a.client.ClientBuilder.findBestClientTransport(ClientBuilder.java:136)
at io.a2a.client.ClientBuilder.buildClientTransport(ClientBuilder.java:92)
at io.a2a.client.ClientBuilder.build(ClientBuilder.java:84)
at io.agentscope.core.a2a.agent.A2aAgent.buildA2aClient(A2aAgent.java:196)
at io.agentscope.core.a2a.agent.A2aAgent$A2aClientLifecycleHook.onEvent(A2aAgent.java:255)
升级到 a2a-java-sdk 1.4.0.Final(#3590)后问题仍在,只是报错变成 Cannot invoke "AgentCard.supportedInterfaces()" because "this.agentCard" is null(位于 ClientBuilder.getServerInterfacesMap)。我在 #3590 上用真实 Nacos 3.2.1 验证时遇到的就是这个。
I would like to work on this with a focused fix: report a missing AgentCard before invoking the A2A SDK, resolve the card once per call and reuse it for the existing diagnostic, and document the resolver's nullable result. I will validate both call and stream failure paths and keep builder-time description discovery and transport behavior unchanged.
Activity
breezeFur commentedon Oct 17, 2026
I would like to work on this with a focused fix: report a missing AgentCard before invoking the A2A SDK, resolve the card once per call and reuse it for the existing diagnostic, and document the resolver's nullable result. I will validate both call and stream failure paths and keep builder-time description discovery and transport behavior unchanged.
guslegend0510 commentedon Oct 17, 2026
会的,我现在在等a2a版本升级到1.0,然后就会解决这个问题