Skip to content

fix(agent): resolve dynamically disclosed skill tools after HITL resumption (#35) - #73

Merged
yuluo-yx merged 1 commit into
agentic-ai-java:mainfrom
ikaitist:fix/35-skills-hitl-tool-callback
Sep 2, 2026
Merged

yuluo-yx merged 1 commit into
agentic-ai-java:mainfrom
ikaitist:fix/35-skills-hitl-tool-callback

Conversation

@ikaitist

@ikaitist ikaitist commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

改动

  • AgentLlmNode 与 AgentToolNode 之间增加共享的进程内动态工具回调注册表(由 DefaultBuilder 创建并注入两个节点);
  • AgentLlmNode 在模型调用时把渐进式披露的动态回调(如 SkillsInterceptor 注入的 skill 工具)同步写入注册表;
  • AgentToolNode.resolve() 在 config context 缺失时回退到注册表查找。

原因

动态工具回调此前只通过 config.context() 传递(AgentLlmNode 中有 FIXME 标记)。子图在 Human-in-the-Loop 中断后恢复时,GraphRunnerContext 会清空 context,导致 AgentToolNode 无法解析已获人工确认的工具,Skills 场景下报 "No ToolCallback found for tool name: queryTool"(issue #35,源自 alibaba/spring-ai-alibaba#4606)。

注册表挂在节点实例上:恢复执行复用同一个 CompiledGraph,节点实例存活,因此回调在恢复后可解析,且不涉及 checkpoint 状态序列化。

验证

  • 新增 AgentToolNodeDynamicToolCallbackRegistryTest:
    • 空 context + 注册表 → 工具正常执行并返回结果;
    • 无注册表条目 → 工具按现有逻辑报告不可用。
  • 本地回归:AgentToolCallingAdvisorBoundaryTest 等 6 个用例通过。

Fixes #35

…mption (agentic-ai-java#35)

Tool callbacks disclosed by progressive-disclosure model interceptors (e.g. skill tools from SkillsInterceptor) were only passed through config.context(), which is cleared when a subgraph resumes after a Human-in-the-Loop interruption, leaving AgentToolNode unable to resolve the approved tool. Share an in-memory registry between AgentLlmNode and AgentToolNode so the disclosed callbacks stay resolvable across resumption, with unit tests covering the empty-context resume scenario.
@github-actions github-actions Bot added the area/core 核心:智能体运行时基础与公共接口 label Sep 2, 2026
@yuluo-yx
yuluo-yx merged commit 8252e5c into agentic-ai-java:main Sep 2, 2026
3 checks passed
yuluo-yx added a commit that referenced this pull request Oct 17, 2026
fix(agent): resolve dynamically disclosed skill tools after HITL resumption (#35)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core 核心:智能体运行时基础与公共接口

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] Skills在使用“渐进式工具 Tool 披露”,使用人工介入(Human-in-the-Loop)时,No ToolCallback found for tool name

2 participants