hermes-agent/tools
lila dd69f16c3e
feat(gateway): expose subagent tool calls and thinking to user (fixes #169) (#186)
When subagents run via delegate_task, the user now sees real-time
progress instead of silence:

CLI: tree-view activity lines print above the delegation spinner
  🔀 Delegating: research quantum computing
     ├─ 💭 "I'll search for papers first..."
     ├─ 🔍 web_search  "quantum computing"
     ├─ 📖 read_file  "paper.pdf"
     └─ ⠹ working... (18.2s)

Gateway (Telegram/Discord): batched progress summaries sent every
5 tool calls to avoid message spam. Remaining tools flushed on
subagent completion.

Changes:
- agent/display.py: add KawaiiSpinner.print_above() to print
  status lines above an active spinner without disrupting animation.
  Uses captured stdout (self._out) so it works inside the child's
  redirect_stdout(devnull).

- tools/delegate_tool.py: add _build_child_progress_callback()
  that creates a per-child callback relaying tool calls and
  thinking events to the parent's spinner (CLI) or progress
  queue (gateway). Each child gets its own callback instance,
  so parallel subagents don't share state. Includes _flush()
  for gateway batch completion.

- run_agent.py: fire tool_progress_callback with '_thinking'
  event when the model produces text content. Guarded by
  _delegate_depth > 0 so only subagents fire this (prevents
  gateway spam from main agent). REASONING_SCRATCHPAD/think/
  reasoning XML tags are stripped before display.

Tests: 21 new tests covering print_above, callback builder,
thinking relay, SCRATCHPAD filtering, batching, flush, thread
isolation, delegate_depth guard, and prefix handling.
2026-02-28 23:18:00 -08:00
..
environments feat(tests): add live integration tests for file operations and shell noise filtering 2026-02-28 22:57:58 -08:00
__init__.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
approval.py fix: prevent false positives in recursive delete detection 2026-02-26 16:32:01 +03:00
browser_tool.py feat(api): implement dynamic max tokens handling for various providers 2026-02-26 20:23:56 -08:00
clarify_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
code_execution_tool.py Fix: #41 2026-02-25 21:16:15 -08:00
cronjob_tools.py fix: cron prompt injection scanner bypass for multi-word variants 2026-02-26 13:55:54 +03: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 feat(gateway): expose subagent tool calls and thinking to user (fixes #169) (#186) 2026-02-28 23:18:00 -08:00
file_operations.py Merge pull request #61 from 0xbyt4/fix/write-deny-macos-symlink 2026-02-27 01:32:19 -08:00
file_tools.py feat: add docker_volumes config for custom volume mounts 2026-02-28 07:12:48 +10:00
fuzzy_match.py Cleanup time! 2026-02-20 23:23:32 -08:00
honcho_tools.py feat: add Honcho AI-native memory integration 2026-02-26 18:07:17 -05:00
image_generation_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
interrupt.py feat: enhance interrupt handling and container resource configuration 2026-02-23 02:11:33 -08: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 Add file manipulation tools and enhance setup scripts 2026-02-05 03:49:46 -08:00
process_registry.py feat(tests): add live integration tests for file operations and shell noise filtering 2026-02-28 22:57:58 -08:00
registry.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
rl_training_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
send_message_tool.py feat: enhance interrupt handling and container resource configuration 2026-02-23 02:11:33 -08:00
session_search_tool.py refactor(cli): Finalize OpenAI Codex Integration with OAuth 2026-02-28 21:47:51 -08:00
skill_manager_tool.py Harden agent attack surface: scan writes to memory, skills, cron, and context files 2026-02-25 23:43:15 -05:00
skills_guard.py Harden agent attack surface: scan writes to memory, skills, cron, and context files 2026-02-25 23:43:15 -05:00
skills_hub.py refactor: enhance error handling with structured logging across multiple modules 2026-02-21 03:32:11 -08:00
skills_sync.py refactor: enhance error handling with structured logging across multiple modules 2026-02-21 03:32:11 -08:00
skills_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
terminal_tool.py test(redact): add sensitive text redaction 2026-02-28 21:56:27 -08:00
todo_tool.py More major refactor/tech debt removal! 2026-02-21 20:22:33 -08:00
transcription_tools.py refactor: streamline API key retrieval in transcription and TTS tools 2026-02-26 19:56:42 -08:00
tts_tool.py refactor: streamline API key retrieval in transcription and TTS tools 2026-02-26 19:56:42 -08:00
vision_tools.py fix(headers): update X-OpenRouter-Categories to include 'productivity' 2026-02-28 10:38:49 -08:00
web_tools.py refactor(cli): Finalize OpenAI Codex Integration with OAuth 2026-02-28 21:47:51 -08:00