hermes-agent/tests/tools
Teknium 02a819b16e
feat(delegate): add observability metadata to subagent results (#1175)
* fix: Home Assistant event filtering now closed by default

Previously, when no watch_domains or watch_entities were configured,
ALL state_changed events passed through to the agent, causing users
to be flooded with notifications for every HA entity change.

Now events are dropped by default unless the user explicitly configures:
- watch_domains: list of domains to monitor (e.g. climate, light)
- watch_entities: list of specific entity IDs to monitor
- watch_all: true (new option — opt-in to receive all events)

A warning is logged at connect time if no filters are configured,
guiding users to set up their HA platform config.

All 49 gateway HA tests + 52 HA tool tests pass.

* docs: update Home Assistant integration documentation

- homeassistant.md: Fix event filtering docs to reflect closed-by-default
  behavior. Add watch_all option. Replace Python dict config example with
  YAML. Fix defaults table (was incorrectly showing 'all'). Add required
  configuration warning admonition.
- environment-variables.md: Add HASS_TOKEN and HASS_URL to Messaging section.
- messaging/index.md: Add Home Assistant to description, architecture
  diagram, platform toolsets table, and Next Steps links.

* fix(terminal): strip provider env vars from background and PTY subprocesses

Extends the env var blocklist from #1157 to also cover the two remaining
leaky paths in process_registry.py:

- spawn_local() PTY path (line 156)
- spawn_local() background Popen path (line 197)

Both were still using raw os.environ, leaking provider vars to background
processes and interactive PTY sessions. Now uses the same dynamic
_HERMES_PROVIDER_ENV_BLOCKLIST from local.py.

Explicit env_vars passed to spawn_local() still override the blocklist,
matching the existing behavior for callers that intentionally need these.

Gap identified by PR #1004 (@PeterFile).

* feat(delegate): add observability metadata to subagent results

Enrich delegate_task results with metadata from the child AIAgent:

- model: which model the child used
- exit_reason: completed | interrupted | max_iterations
- tokens.input / tokens.output: token counts
- tool_trace: per-tool-call trace with byte sizes and ok/error status

Tool trace uses tool_call_id matching to correctly pair parallel tool
calls with their results, with a fallback for messages without IDs.

Cherry-picked from PR #872 by @omerkaz, with fixes:
- Fixed parallel tool call trace pairing (was always updating last entry)
- Removed redundant 'iterations' field (identical to existing 'api_calls')
- Added test for parallel tool call trace correctness

Co-authored-by: omerkaz <omerkaz@users.noreply.github.com>

---------

Co-authored-by: omerkaz <omerkaz@users.noreply.github.com>
2026-03-13 08:07:12 -07:00
..
__init__.py
test_approval.py feat: add 'View full command' option to dangerous command approval (#887) 2026-03-12 06:27:21 -07:00
test_browser_console.py fix: update all test mocks for call_llm migration 2026-03-11 21:06:54 -07:00
test_checkpoint_manager.py feat: filesystem checkpoints and /rollback command 2026-03-10 00:49:15 -07:00
test_clarify_tool.py
test_clipboard.py
test_code_execution.py fix: skip hanging tests + add global test timeout 2026-03-12 01:23:28 -07:00
test_cron_prompt_injection.py
test_cronjob_tools.py
test_daytona_environment.py
test_debug_helpers.py
test_delegate.py feat(delegate): add observability metadata to subagent results (#1175) 2026-03-13 08:07:12 -07:00
test_docker_find.py fix: Docker backend fails when docker is not in PATH (macOS gateway) 2026-03-10 20:45:13 -07:00
test_file_operations.py
test_file_tools_live.py fix: skip hanging tests + add global test timeout 2026-03-12 01:23:28 -07:00
test_file_tools.py
test_force_dangerous_override.py
test_fuzzy_match.py
test_hidden_dir_filter.py
test_homeassistant_tool.py
test_interrupt.py feat: concurrent tool execution with ThreadPoolExecutor 2026-03-13 02:51:51 -07:00
test_local_env_blocklist.py fix(terminal): strip Hermes provider env vars from subprocess environment (#1157) 2026-03-13 07:52:03 -07:00
test_mcp_tool.py merge: resolve conflicts with origin/main 2026-03-12 00:29:04 -07:00
test_memory_tool.py
test_modal_sandbox_fixes.py fix: skip tests when atroposlib/minisweagent unavailable in CI 2026-03-11 06:52:55 -07:00
test_parse_env_var.py test(terminal): add tests for env var validation in _get_env_config 2026-03-11 02:59:12 -07:00
test_patch_parser.py
test_process_registry.py
test_read_loop_detection.py fix: improve read-loop detection — consecutive-only, correct thresholds, fix bugs 2026-03-10 16:25:41 -07:00
test_registry.py feat: secure skill env setup on load (core #688) 2026-03-13 03:14:04 -07:00
test_rl_training_tool.py fix: call _stop_training_run on early-return failure paths 2026-03-10 17:09:51 -07:00
test_send_message_tool.py fix(gateway): isolate telegram forum topic sessions 2026-03-11 09:15:34 +01:00
test_session_search.py fix: update all test mocks for call_llm migration 2026-03-11 21:06:54 -07:00
test_skill_manager_tool.py
test_skill_view_path_check.py
test_skill_view_traversal.py
test_skills_guard.py
test_skills_hub_clawhub.py
test_skills_hub.py
test_skills_sync.py
test_skills_tool.py fix: improve gateway secret capture guidance message 2026-03-13 04:10:22 -07:00
test_symlink_prefix_confusion.py
test_terminal_disk_usage.py
test_todo_tool.py
test_vision_tools.py fix: update all test mocks for call_llm migration 2026-03-11 21:06:54 -07:00
test_web_tools_config.py
test_windows_compat.py
test_write_deny.py
test_yolo_mode.py Merge PR #724: feat: --yolo flag to bypass all approval prompts 2026-03-10 20:56:30 -07:00