Add opt-in Headroom Phase 1 tool-output compression plugin - #40322
Closed
channkim wants to merge 1 commit into
Closed
Add opt-in Headroom Phase 1 tool-output compression plugin#40322channkim wants to merge 1 commit into
channkim wants to merge 1 commit into
Conversation
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for keeping the experiment opt-in and using the existing transform_tool_result seam.
Problems
- Current main changed the
search_fileswire shape in merged #47866:tools/file_tools.py:2004requestsdensify=True, andtools/file_operations.py:281-297emitsmatches_textfor five or more matches. This PR's_compress_search_files()only recognizesmatches,files, andcounts, so it returns no transformation for the current densified result. The added tests exercise only the oldermatchesarray. - The PR adds non-secret
HERMES_HEADROOM_*enablement, kill-switch, and allowlist settings.website/docs/user-guide/configuration.md:53-60requires behavioral settings to live inconfig.yaml.
Suggested changes
- Re-scope
search_filesaround the native lossless representation from #47866, and add real-path coverage formatches_textplus the below-threshold array form. - Keep activation and limits in
config.yaml; remove the new behavioral environment overrides.
Automated hermes-sweeper review.
| def _clip_text(value: Any, max_chars: int) -> str: | ||
| text = str(value) | ||
| if len(text) <= max_chars: | ||
| return text |
Contributor
There was a problem hiding this comment.
Current main's search_files output uses matches_text rather than matches when it has at least five matches (tools/file_tools.py:2004, tools/file_operations.py:281-297). This branch will therefore skip the common current result shape; add coverage using the real densified payload or re-scope this transformer around the native lossless representation.
This was referenced Aug 19, 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.
Summary
Promote the Headroom structured tool-output compression experiment to Phase 1 as disabled-by-default code + tests only.
headroomplugin using the existingtransform_tool_resulthook.headroomconfig block.search_filesandbrowser_snapshot; config can narrow but not widen the allowlist.terminal,read_file,delegate_task,patch,write_file,memory,send_message,clarify, andcronjob.search_filesJSON plus pagination hint suffix.Non-goals / invariants
headroom.enableddefaults tofalse.Validation
Ran locally:
Results:
tests/plugins/test_headroom_plugin.py: 19 passedpy_compile: passedgit diff --check: passedReview
Codex adversarial review initially found two blockers:
headroom.excluded_toolswas exposed but not read.search_filesoutput appends a plaintext hint after JSON, causing parsing to skip compression.Both were fixed and re-reviewed. Final Codex review verdict: PASS.
Handoff
feat/headroom-phase18e5acc7b5plugins/headroom/__init__.pyplugins/headroom/plugin.yamlhermes_cli/config.pytests/plugins/test_headroom_plugin.pyFollow-ups before Phase 2
/compress, resume, missing handle, kill switch, scope isolation, and untrusted wrapper tests before any live canary.