Skip to content

[Bug]:Agent As Tool + A2A形式调用远程子智能体时,Msg中的metadata信息丢失。 #680

@yisheng13

Description

@yisheng13

Agent As Tool + A2A形式调用远程子智能体时,Msg中的metadata信息丢失。但如果客户端直接A2A调用时,Msg中的metadata信息可以正确传输。
客户端代码
Agent As Tool + A2A形式调用

        Toolkit toolkit = new Toolkit();
        toolkit.registration()
                .subAgent(() -> A2aAgent.builder()
                        .name("timeExpert")
                        .agentCardResolver(resolver)
                        .build())
                .apply();
        ReActAgent mainAgent = ReActAgent.builder()
                .name("Coordinator")
                .sysPrompt("你叫 Tom ,是一个智能助手。当遇到时间相关问题时,调用 call_timeexpert 工具咨询 Jarvis。")
                .model(model)
                .memory(new InMemoryMemory())
                .toolkit(toolkit)
                .build();
        Msg userMsg = Msg.builder()
                .textContent("请告诉我今天的日期。")
                .metadata(Map.of("useriId", "1234567890"))
                .build();
        Msg response = mainAgent.call(userMsg).block();

服务端收到的请求中metadata无内容
Image

如果客户端直接A2A调用

        A2aAgent agent = A2aAgent.builder()
                .name("remote-agent")
                .agentCardResolver(resolver)
                .build();
        Msg msg = Msg.builder()
                .textContent("今天的日期是什么?")
                .metadata(Map.of("userId", "1234567890"))
                .build();
         Msg response = agent.call(msg).block();
Image

这导致在主智能体调用远程子智能体时,无法通过Msg传输一些特定参数。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions