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
updateToolGroups() does not take effect on existing ReActAgent instance #1203
I reproduced this by tracing ReActAgent.Builder.build(): the builder deep-copies the provided Toolkit, so later toolkit.updateToolGroups(...) only mutates the caller-owned toolkit while the existing agent keeps using its internal snapshot. That is why newly activated groups are still missing from the tool schemas sent to the model on subsequent calls.
I'm working on a fix that keeps the per-agent toolkit isolation but synchronizes external tool-group activation state for new invocations, and I'll add regression tests for repeated calls and streaming calls on an already-built agent.
我的一个测试用例输出日志(定义了一个search组,组内有一个web_search工具),最初这个组是未激活的,在运行时,智能体激活了search组,但检查工具是否激活时,发现web_search未激活,通过的不过,发现是激活的组用的Toolkit和判断工具是否激活使用的Toolkit实例不是同一个。
19:05:06.200 [boundedElastic-1] INFO io.agentscope.core.tool.ToolGroupManager -- Tool group 'search' active status set to: true
19:06:52.406 [boundedElastic-3] WARN io.agentscope.core.tool.ToolExecutor -- Unauthorized tool call: 'web_search' is not available
Activity
jujn commentedon Apr 12, 2026
ReActAgent 在构建(build)时对 Toolkit 进行了深拷贝(防止多个Agent 共享同一个 Toolkit 并发问题)。可以试试 通过 Agent 获取其内部 Toolkit 实例:
Alexxigang commentedon Apr 12, 2026
I reproduced this by tracing
ReActAgent.Builder.build(): the builder deep-copies the providedToolkit, so latertoolkit.updateToolGroups(...)only mutates the caller-owned toolkit while the existing agent keeps using its internal snapshot. That is why newly activated groups are still missing from the tool schemas sent to the model on subsequent calls.I'm working on a fix that keeps the per-agent toolkit isolation but synchronizes external tool-group activation state for new invocations, and I'll add regression tests for repeated calls and streaming calls on an already-built agent.
Alexxigang commentedon Apr 12, 2026
Opened PR #1206: #1206
wiscloud commentedon Apr 13, 2026
这个问题是不是会导致在运行时,让智能体根据任务需求自主选择激活哪些工具组,这个功能失败,对应的文档地址:https://java.agentscope.io/zh/task/tool.html#id19
我的一个测试用例输出日志(定义了一个search组,组内有一个web_search工具),最初这个组是未激活的,在运行时,智能体激活了search组,但检查工具是否激活时,发现web_search未激活,通过的不过,发现是激活的组用的Toolkit和判断工具是否激活使用的Toolkit实例不是同一个。
19:05:06.200 [boundedElastic-1] INFO io.agentscope.core.tool.ToolGroupManager -- Tool group 'search' active status set to: true
19:06:52.406 [boundedElastic-3] WARN io.agentscope.core.tool.ToolExecutor -- Unauthorized tool call: 'web_search' is not available