fix: preserve skill isolation and tool result history#2319
Open
RainYuY wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
@chickenlj @jujn PTAL |
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.1-SNAPSHOT
Description
Background
This PR fixes several correctness, compatibility, and session-isolation issues in the Harness skill runtime and tool-result eviction flow.
Previously:
SkillCatalog, allowing one session to overwrite or observe another session's filtered skill view.WorkspaceSkillRepositorycould resolve skills using another concurrent session's active runtime context.load_skill_through_pathafter upgrading.Changes
Session and toolkit state
toolkit_activeGroupskey from a present but empty value.RuntimeContextwhen merging toolkit-level execution context.Skill runtime
HarnessSkillMiddlewarefor both live and frozen repository modes.SkillFilterandSkillVisibilityFilterbefore staging, prompt rendering, and catalog installation.RuntimeContextSkillRepositoryfor repositories whose contents depend on the current request.WorkspaceSkillRepositoryenumerate skills using the supplied request context.SkillCatalogin the request-scopedRuntimeContextinstead of a shared mutable reference.load_skill_through_pathauthorization from the tool call's runtime context.Tool-result eviction
AgentStateand the hook-modifiedReasoningInput.ToolResultBlock.large_tool_resultspath.Compatibility
The following previously published APIs remain available as deprecated compatibility paths:
SkillRuntime.currentCatalog()SkillRuntime.install(SkillCatalog, Toolkit)SkillLoadTool(AtomicReference<SkillCatalog>)Context-bearing tool calls never fall back to the legacy shared catalog, preserving session isolation.
How to test
The focused core and Harness regression suite can be run with:
mvn -pl agentscope-harness -am \ -Dtest=ReActAgentPerSessionStateTest,ToolExecutionContextIntegrationTest,ToolResultEvictionMiddlewareTest,HarnessSkillMiddlewareContextIsolationTest,WorkspaceSkillRepositoryTest,SkillRuntimeTest,SkillLoadToolFrontmatterViewTest,HarnessAgentDynamicHookBuilderTest \ -Dsurefire.failIfNoSpecifiedTests=false \ test