版本为1.1.0-RC2 在client端调用agent发送请求时,会调用A2aAgent的doCall方法,doCall方法会对消息进行处理,将多条消息合并为一条消息。 <img width="999" height="1051" alt="Image" src="https://github.com/user-attachments/assets/78a26c59-87dc-4f01-910f-8fa1a0b5ec96" /> convertFromMsg方法会将消息的metadata变为<msgId,metadata>的键值对。 <img width="939" height="908" alt="Image" src="https://github.com/user-attachments/assets/b2620ed6-47de-4ddf-afcc-19352f176a43" /> 但是在server端进行解析时存在不一致,导致下面两个方法无法正确获取到userId、sessionId <img width="1179" height="1116" alt="Image" src="https://github.com/user-attachments/assets/0d083b05-24b2-437e-8bd1-79f9affa359a" /> <img width="721" height="302" alt="Image" src="https://github.com/user-attachments/assets/da554a4c-775f-4716-b806-48c3555d667f" /> 这是我的client端代码 public class A2aAgentClient { public static void main(String[] args) { // 创建 A2A Agent A2aAgent agent = A2aAgent.builder() .name("remote-agent") .agentCardResolver( WellKnownAgentCardResolver.builder() .baseUrl("http://127.0.0.1:8946") .build() ) .build(); Msg response = agent.call(Msg.builder().textContent("你好 我是张三").metadata(Map.of("userId","11")).build()) .block(); String collect = response.getContent() .stream() .filter(TextBlock.class::isInstance) .map(TextBlock.class::cast) .map(TextBlock::getText) .collect(Collectors.joining()); System.out.println(collect); } } 这是server端debug的截图,可以明显看到metadata中的结构 <img width="1361" height="975" alt="Image" src="https://github.com/user-attachments/assets/104a028f-6043-423f-8f83-8848fed08c48" />
Activity
fix(a2a): resolve runner session IDs while preserving legacy metadata (…
fix(a2a): propagate userId/sessionId end-to-end across the wire (agen…