hermes-agent/tools
teknium1 a458b535c9 fix: improve read-loop detection — consecutive-only, correct thresholds, fix bugs
Follow-up to PR #705 (merged from 0xbyt4). Addresses several issues:

1. CONSECUTIVE-ONLY TRACKING: Redesigned the read/search tracker to only
   warn/block on truly consecutive identical calls. Any other tool call
   in between (write, patch, terminal, etc.) resets the counter via
   notify_other_tool_call(), called from handle_function_call() in
   model_tools.py. This prevents false blocks in read→edit→verify flows.

2. THRESHOLD ADJUSTMENT: Warn on 3rd consecutive (was 2nd), block on
   4th+ consecutive (was 3rd+). Gives the model more room before
   intervening.

3. TUPLE UNPACKING BUG: Fixed get_read_files_summary() which crashed on
   search keys (5-tuple) when trying to unpack as 3-tuple. Now uses a
   separate read_history set that only tracks file reads.

4. WEB_EXTRACT DOCSTRING: Reverted incorrect removal of 'title' from
   web_extract return docs in code_execution_tool.py — the field IS
   returned by web_tools.py.

5. TESTS: Rewrote test_read_loop_detection.py (35 tests) to cover
   consecutive-only behavior, notify_other_tool_call, interleaved
   read/search, and summary-unaffected-by-searches.
2026-03-10 16:25:41 -07:00
..
environments fix(security): pipe sudo password via stdin instead of shell cmdline 2026-03-10 06:34:59 -07:00
__init__.py docs: complete Daytona backend documentation coverage 2026-03-06 03:37:05 -08:00
approval.py fix(security): use in-memory set for permanent allowlist save 2026-03-07 19:33:30 +03:30
browser_tool.py fix: replace silent exception swallowing with debug logging across tools 2026-03-10 06:59:20 -07:00
checkpoint_manager.py feat: filesystem checkpoints and /rollback command 2026-03-10 00:49:15 -07:00
clarify_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
code_execution_tool.py fix: improve read-loop detection — consecutive-only, correct thresholds, fix bugs 2026-03-10 16:25:41 -07:00
cronjob_tools.py fix: Signal adapter parity pass — integration gaps, clawdbot features, env var simplification 2026-03-08 21:00:21 -07:00
debug_helpers.py refactor: consolidate debug logging across tools with shared DebugSession class 2026-02-21 03:53:24 -08:00
delegate_tool.py fix: replace silent exception swallowing with debug logging across tools 2026-03-10 06:59:20 -07:00
file_operations.py Merge PR #533: fix: use regex for search output parsing to handle Windows drive-letter paths 2026-03-09 23:18:42 -07:00
file_tools.py fix: improve read-loop detection — consecutive-only, correct thresholds, fix bugs 2026-03-10 16:25:41 -07:00
fuzzy_match.py Cleanup time! 2026-02-20 23:23:32 -08:00
homeassistant_tool.py feat: enhance Home Assistant integration with service discovery and setup 2026-03-03 05:16:53 -08:00
honcho_tools.py feat: add Honcho AI-native memory integration 2026-02-26 18:07:17 -05:00
image_generation_tool.py Fix image_generate 'Event loop is closed' in gateway 2026-03-07 16:56:49 -08:00
interrupt.py feat: enhance interrupt handling and container resource configuration 2026-02-23 02:11:33 -08:00
mcp_tool.py feat(mcp): add sampling support — server-initiated LLM requests (#753) 2026-03-09 03:37:38 -07:00
memory_tool.py Fix memory tool entry parsing when content contains section sign 2026-02-28 01:33:41 +03:00
mixture_of_agents_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
openrouter_client.py fix(headers): update X-OpenRouter-Categories to include 'productivity' 2026-02-28 10:38:49 -08:00
patch_parser.py fix: align _apply_delete comment with actual behavior 2026-02-28 22:58:01 +02:00
process_registry.py Merge PR #457: Use pywinpty for PTY support on Windows 2026-03-09 21:09:56 -07:00
registry.py Merge PR #275: fix(batch_runner): preserve traceback when batch worker fails 2026-03-05 01:44:05 -08:00
rl_training_tool.py Update MiniMax model ID from m2.1 to m2.5 2026-03-06 16:47:48 +08:00
send_message_tool.py fix: Signal adapter parity pass — integration gaps, clawdbot features, env var simplification 2026-03-08 21:00:21 -07:00
session_search_tool.py refactor: clean up type hints and docstrings in session_search_tool 2026-03-04 21:25:54 -08:00
skill_manager_tool.py Make skill file writes atomic 2026-03-07 00:49:10 +03:00
skills_guard.py Add OpenRouter app attribution headers to skills_guard and trajectory_compressor 2026-03-08 14:23:18 -07:00
skills_hub.py fix: review fixes — path traversal guard, trust_style consistency, edge cases 2026-03-06 01:40:01 -08:00
skills_sync.py fix: make skills manifest writes atomic 2026-03-08 23:53:57 -07:00
skills_tool.py Merge PR #617: Improve skills tool error handling 2026-03-10 04:32:26 -07:00
terminal_tool.py fix: replace silent exception swallowing with debug logging across tools 2026-03-10 06:59:20 -07:00
todo_tool.py fix: escalate read/search blocking, track search loops, filter completed todos 2026-03-08 23:01:21 +03:00
transcription_tools.py refactor: clean up transcription_tools after PR #262 merge 2026-03-04 21:35:04 -08:00
tts_tool.py Improve TTS error handling and logging 2026-03-07 16:53:30 +03:00
vision_tools.py Merge PR #428: Improve type hints and error diagnostics in vision_tools 2026-03-09 15:27:54 -07:00
web_tools.py feat: enhance auxiliary model configuration and environment variable handling 2026-03-08 18:06:47 -07:00