agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Feature]: Support passing user-defined fields in `SubAgentTool`

Open AlbumenJ opened this issue 10 months ago • 4 comments

Problem Description Currently, SubAgentTool is implemented solely based on conversation history. Consequently, users cannot pass external parameters (e.g., userId) to the sub-agent securely or accurately.

Proposed Solution We need to design a mechanism that allows users to define and pass specific fields to the SubAgentTool explicitly.

AlbumenJ avatar Jan 08 '26 11:01 AlbumenJ

@AlbumenJ I'm interested in this issue. Please assign it to me.

ShenJunkun avatar Jan 11 '26 11:01 ShenJunkun

@AlbumenJ I have gone through the code in SubAgentTool.java, and I have a few questions I’d like to ask:

  • How will these external parameters be used? For example, if a userId is passed to a sub-agent, how specifically will the sub-agent utilize it?
  • How should I handle these external parameters? Should I concatenate them with the userMsg?https://github.com/agentscope-ai/agentscope-java/blob/b317f0329c1b08074699c98882cb613f88adaae9/agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java#L152-L157

ShenJunkun avatar Jan 11 '26 12:01 ShenJunkun

It's better to define a custom Msg. We also support call(List<Msg>). The Msg can contain custom parameters. I would like to extract this key as a Tool parameter, which can be injected either by the model or via the ToolExecutionContext.

AlbumenJ avatar Jan 12 '26 09:01 AlbumenJ

I'm also stuck here now, is there any progress?

chcodex avatar Feb 27 '26 06:02 chcodex