hermes-agent/tools
Teknium ccec8f3e53
Port from can1357/oh-my-pi#7906: recover line-number-gutter pasted old_string in patch tool
Models sometimes paste old_string (and new_string) straight from
read_file/search_files output, which prefixes every line with the
'N|' gutter. The file has no such prefixes, so all 9 fuzzy strategies
fail and the model burns turns re-reading and re-patching.

When every non-empty line of old_string carries a uniform,
mostly-consecutive 'digits|' prefix — the same verbatim-paste signature
write_file already rejects via _looks_like_read_file_line_numbered_content
— strip the gutter from both strings and retry the strategy chain once.
Mixed prefixes, non-consecutive numbers, or a single numbered line are
treated as genuine content and left alone. An exact literal match always
wins first, so files that really contain gutter-shaped text are unaffected.

Strategy name is reported as '<strategy>+gutter_stripped' for telemetry.
Sabotage-verified: recovery tests fail without the fix.
2026-08-08 20:12:36 -07:00
..
computer_use
…
environments fix(environments): surface stdin write failures as stdin_error (#79178) 2026-08-08 12:31:19 -07:00
neutts_samples
…
wakewords
…
__init__.py
…
ansi_strip.py
…
approval.py
…
async_delegation.py
…
audio_container.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
…
close_terminal_tool.py
…
code_execution_tool.py fix(tools): make json_parse tolerate UTF-8 BOM (salvage #57870) 2026-08-08 12:32:23 -07:00
computer_use_tool.py
…
credential_files.py
…
cronjob_tools.py
…
daemon_pool.py
…
debug_helpers.py
…
delegate_tool.py
…
delegation_live_log.py
…
delegation_output_schema.py
…
desktop_ui.py
…
discord_tool.py
…
env_passthrough.py
…
env_probe.py
…
fal_common.py
…
feishu_doc_tool.py
…
feishu_drive_tool.py
…
file_operations.py fix(file-ops): classify binary files at the byte layer, not on transport-lossy text 2026-08-08 12:34:06 -07:00
file_state.py
…
file_tools.py
…
flux3_video_tool.py
…
focus_pane_tool.py
…
fuzzy_match.py Port from can1357/oh-my-pi#7906: recover line-number-gutter pasted old_string in patch tool 2026-08-08 20:12:36 -07:00
homeassistant_tool.py
…
hook_output_spill.py
…
image_generation_tool.py Add more FAL models to nous portal (#82019) 2026-08-08 19:59:12 -04:00
image_source.py
…
interrupt.py
…
kanban_tools.py
…
lazy_deps.py fix(deps): mirror aiohttp 3.14.3 pin into lazy_deps feature specs 2026-08-08 14:06:48 -07:00
managed_tool_gateway.py fix(gateway): read auth.json as UTF-8 in _read_nous_provider_state 2026-08-08 12:32:23 -07:00
mcp_dashboard_oauth.py
…
mcp_oauth.py
…
mcp_oauth_manager.py
…
mcp_schema_cache.py
…
mcp_stdio_watchdog.py
…
mcp_tool.py
…
memory_tool.py fix: finish the missing-encoding sweep — BOM-tolerant reads for user-edited stores 2026-08-08 12:32:23 -07:00
microsoft_graph_auth.py
…
microsoft_graph_client.py
…
neutts_synth.py
…
open_preview_tool.py
…
openrouter_client.py
…
osv_check.py
…
patch_parser.py
…
path_security.py
…
process_registry.py fix(process_registry): surrogateescape-safe PTY stdin writes (#79178) 2026-08-08 12:31:19 -07:00
project_tools.py
…
react_to_message_tool.py
…
read_extract.py
…
read_preview_tool.py
…
read_terminal_tool.py
…
read_window_tool.py fix(build): win32 get-windows staging must skip the tarball's bundled darwin binding 2026-08-08 12:17:50 -05:00
registry.py
…
schema_sanitizer.py
…
self_repo_guard.py
…
send_message_tool.py
…
session_search_tool.py
…
skill_linter.py fix: suppress windows-footgun false positives in linter pattern list 2026-08-08 11:12:27 -07:00
skill_manager_tool.py feat(skills): advisory SKILL.md convention linter on create 2026-08-08 11:12:27 -07:00
skill_provenance.py
…
skill_usage.py
…
skills_ast_audit.py
…
skills_guard.py
…
skills_hub.py
…
skills_sync.py
…
skills_sync_client.py
…
skills_tool.py fix: finish the missing-encoding sweep — BOM-tolerant reads for user-edited stores 2026-08-08 12:32:23 -07:00
slash_confirm.py
…
terminal_hints.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_streaming.py
…
tts_text_normalize.py
…
tts_tool.py fix(tts): split long speech by provider and platform limits 2026-08-08 22:54:20 +05:30
url_safety.py
…
video_generation_tool.py Add more FAL models to nous portal (#82019) 2026-08-08 19:59:12 -04:00
vision_tools.py
…
voice_mode.py
…
wake_word.py
…
web_tools.py
…
website_policy.py
…
working_diff.py fix(tools): decode git output as UTF-8 in working_diff on Windows 2026-08-08 12:34:46 -07:00
write_approval.py
…
x_search_tool.py
…
xai_http.py fix(auth): cover remaining auth.json readers across modules 2026-08-08 12:32:23 -07:00
xai_video_tools.py
…
yuanbao_tools.py
…