Skip to content

fix(compressor): _prune_old_tool_results boundary direction - #19725

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(compressor): _prune_old_tool_results boundary direction#19725
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1

@teknium1 teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #16228 onto current main.

Summary

The function's docstring promised 'the token budget takes priority and the message count acts as a hard minimum floor', but prune_boundary = max(boundary, len(result) - min_protect) inverted the semantics in index-space (smaller index = more protected). A generous budget silently got truncated back down to min_protect. Translate the budget walk into a protected count, apply the floor in count-space, convert back to a prune boundary.

Validation

scripts/run_tests.sh tests/run_agent/ -k compressor -> passed

Original PR: #16228

@teknium1
teknium1 merged commit b7bbc62 into main May 4, 2026
7 of 10 checks passed
@teknium1
teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 12:05
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants