Repository navigation
Conversation
session_search caps the number of matches (agentscope-ai#3270) but not their size; each match embeds a whole stored message, so a few matches can exceed the eviction threshold. Remove session_search from the default ToolResultEvictionConfig exclusions so oversized results are offloaded with a head/tail preview and a read_file pointer. Fixes agentscope-ai#4098
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
jujn
approved these changes
Nov 13, 2026
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.1.0-SNAPSHOT (main)
Description
Fixes #4098
session_searchonly caps the number of matches (#3270), not their size. Each match embeds a whole stored message, so a handful of matches can exceed the eviction threshold. Becausesession_searchwas inToolResultEvictionConfig.DEFAULT_EXCLUDED_TOOLS, such results were never offloaded and could push the next model request over budget.Changes:
session_searchfromToolResultEvictionConfig.DEFAULT_EXCLUDED_TOOLS. Results under the threshold (80K chars by default) are unchanged; larger ones get the usual head/tail preview and aread_filepointer. Long single-line offload files are readable since fix(harness): bound read_file output with Unicode-safe pagination #3821.SessionSearchToolcomment that relied on the exclusion.docs/v2/{en,zh}/docs/harness/context.md.The prune exclusion in
CompactionConfig.PruneConfigis left unchanged: once a large result is offloaded, only the preview stays inline.Compatibility: users who set
excludedToolNamesexplicitly are not affected. With default settings,session_searchresults over 80K chars are now offloaded instead of kept inline.How to test:
ToolResultEvictionMiddlewareTest#defaultConfigEvictsOversizedSessionSearchButNotReadFile: with default config, an oversizedsession_searchresult is offloaded and an oversizedread_fileresult is not. It fails on main and passes with this change.mvn -B -T1C -pl agentscope-harness -am verify: passed (core 3060, 577, harness 1624 tests, 0 failures).Checklist
mvn spotless:applymvn test)