fix(harness): activate skill-bound tool groups on skill load - #2662
Open
StevenZhang2002 wants to merge 3 commits into
Open
fix(harness): activate skill-bound tool groups on skill load#2662StevenZhang2002 wants to merge 3 commits into
StevenZhang2002 wants to merge 3 commits into
Conversation
SkillLoadTool now activates SkillToolGroups bound via activateOnSkill whenever a skill resource loads successfully, matching the core SkillToolFactory semantics so HarnessAgent exposes the tools on demand. SkillRuntime injects the agent toolkit into the load tool and binds it to the call-scoped RuntimeContext. Fixes agentscope-ai#2653
Fix the duplicated 'either,' typo in the Apache-2.0 license header of SkillLoadToolToolGroupActivationTest so the license check passes.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add tests for SkillLoadTool covering the shared toolkit fallback when no toolkit is present in the RuntimeContext, defensive success when no toolkit is reachable, and resilience when tool group activation throws. Fixes agentscope-ai#2653
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.0.3-SNAPSHOT
Description
SkillLoadTool now activates SkillToolGroups bound via activateOnSkill whenever a skill resource loads successfully, matching the core SkillToolFactory semantics so HarnessAgent exposes the tools on demand. SkillRuntime injects the agent toolkit into the load tool and binds it to the call-scoped RuntimeContext.
Background
Issue #2653: HarnessAgent (Skill + ToolGroup: on-demand tool disclosure) not work. When a skill declares tool groups via
activateOnSkill, loading the skill through HarnessAgent'sSkillLoadToolonly returned the resource text but never activated the boundSkillToolGroups, so the model could not see or call those tools. The core skill access tool (SkillToolFactory.activateSkill, used by ReActAgent) already performed this activation — the harness implementation was missing it.Changes made
SkillLoadTool: after a skill resource loads successfully (SKILL.md / in-memory / lazy), resolves the agent toolkit and activates every inactiveSkillToolGroupbound viaactivateOnSkill(newtoolkitFor/activateSkillToolshelpers). Activation failures are logged as warnings and never block resource delivery.SkillRuntime: keeps anAtomicReference<Toolkit>refreshed inprepareToolkit, and binds the live toolkit into the call-scopedRuntimeContextininstall, so the load tool can reach the actual agent toolkit.SkillLoadToolToolGroupActivationTest(new): verifies that loading a skill activates the associated skill-bound tool group, and that its tools become visible afterwards.How to test
mvn test -pl agentscope-harness -Dtest=SkillLoadToolToolGroupActivationTestFixes #2653
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)