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
Eviction/prune exclusions match tool names; custom tools sharing built-in names are wrongly exempt #4293
Name matching misfires: a custom tool registered under read_file is silently exempt from eviction and pruning even though it is not the framework's paginated reader — its oversized results stay inline and blow up the context budget. The exemption intent ("this tool's results are small or self-paginating") is a property of the tool, not of its name. The two default lists also differ from each other, which is invisible to users and easy to get wrong when adding tools.
Proposal
Declare the exemption on the tool itself, like readOnly/concurrencySafe:
@Tool(evictable = false) / @Tool(prunable = false) (default true), exposed via AgentTool.isEvictable()/isPrunable() and ToolBase.Builder
consumers read declarations from the agent's toolkit: ToolResultEvictionMiddleware merges them with excludedToolNames(...); CompactionMiddleware folds them into the effective prune config via withPruneExclusions(...)
built-in tools declare themselves, so default protection for them is unchanged
the config name lists become user overrides with empty defaults; DEFAULT_EXCLUDED_TOOLS is kept as a deprecated constant for source compatibility
Behavior change: an undeclared custom tool registered under a built-in name is now evicted/pruned like any other tool. Users who deregister tools while their results remain in history can pin names via the config lists.
Activity
feat(core): evictable/prunable tool metadata replaces exclusion name …