hermes-agent/tools
Teknium 22b6942fc2
feat(search_files): headroom compression evaluation report + lossless densification (#47866)
* feat(search_files): path-grouped lossless densification of content matches

Content-mode search_files results repeat the {path,line,content} JSON keys
and the full path string for every match. Group consecutive same-path matches
under one path header with indented '<line>: <content>' rows — lossless (every
path/line/content byte preserved), self-describing (matches_format key), and
readable by the model with no decode step.

57.8% mean token reduction on real search_files content outputs (422-output
corpus), fires on 97% of them. Gated at >=5 matches; below that the verbose
array is left untouched. Default to_dict(densify=False) is unchanged, so no
other caller is affected.

ripgrep emits matches path-ordered, so consecutive grouping never reorders
results.

* test: accept densify kwarg in _FakeSearchResult.to_dict

The search loop-detection tests stub SearchResult with a fake whose
to_dict() must mirror the real signature now that it takes densify=.

* test(search_files): edge-case losslessness battery for densification

Adversarial single-line content (colons, indentation, unicode/emoji, empty,
trailing whitespace, quotes+commas), paths with spaces, and an explicit
one-line-per-match invariant documenting the ripgrep contract the format
relies on (0/6775 real match contents contained a newline).
2026-06-17 13:45:25 -07:00
..
computer_use
environments
neutts_samples
__init__.py
ansi_strip.py
approval.py
async_delegation.py
binary_extensions.py
blueprints.py
browser_camofox.py
browser_camofox_state.py
browser_cdp_tool.py
browser_dialog_tool.py
browser_supervisor.py
browser_tool.py
budget_config.py
checkpoint_manager.py
clarify_gateway.py
clarify_tool.py
code_execution_tool.py
computer_use_tool.py
credential_files.py
cronjob_tools.py
debug_helpers.py
delegate_tool.py
discord_tool.py
env_passthrough.py
env_probe.py
fal_common.py
feishu_doc_tool.py
feishu_drive_tool.py
file_operations.py feat(search_files): headroom compression evaluation report + lossless densification (#47866) 2026-06-17 13:45:25 -07:00
file_state.py
file_tools.py feat(search_files): headroom compression evaluation report + lossless densification (#47866) 2026-06-17 13:45:25 -07:00
fuzzy_match.py
homeassistant_tool.py
image_generation_tool.py
interrupt.py
kanban_tools.py
lazy_deps.py
managed_tool_gateway.py
mcp_oauth.py
mcp_oauth_manager.py
mcp_tool.py refactor: remove agent-callable send_message tool (#47856) 2026-06-17 07:11:23 -07:00
memory_tool.py
microsoft_graph_auth.py
microsoft_graph_client.py
mixture_of_agents_tool.py
neutts_synth.py
openrouter_client.py
osv_check.py
patch_parser.py
path_security.py
process_registry.py
read_extract.py
read_terminal_tool.py
registry.py
schema_sanitizer.py
send_message_tool.py refactor: remove agent-callable send_message tool (#47856) 2026-06-17 07:11:23 -07:00
session_search_tool.py
skill_manager_tool.py
skill_provenance.py
skill_usage.py
skills_ast_audit.py
skills_guard.py
skills_hub.py
skills_sync.py
skills_tool.py
slash_confirm.py
terminal_tool.py
thread_context.py
threat_patterns.py
tirith_security.py
todo_tool.py
tool_backend_helpers.py
tool_output_limits.py
tool_result_storage.py
tool_search.py
transcription_tools.py
tts_tool.py
url_safety.py
video_generation_tool.py
vision_tools.py
voice_mode.py
web_tools.py
website_policy.py
write_approval.py
x_search_tool.py
xai_http.py
yuanbao_tools.py