hermes-agent/tests
Hermes Agent 8cf7e80fc5 feat(gateway): auto-reload MCP connections on config change
Add a background _mcp_config_watcher() task to the gateway that polls
config.yaml every 30 seconds and auto-reloads MCP server connections
when the mcp_servers section changes.

This solves the problem where OAuth token refresh cron jobs update
Bearer tokens in config.yaml, but the running gateway keeps using
stale cached credentials until manually restarted.

The CLI already had this via _check_config_mcp_changes() — this ports
the same concept to the async gateway event loop.

Changes:
- GatewayRunner.__init__: initialize _mcp_config_mtime and
  _mcp_config_servers state from current config
- GatewayRunner.start(): launch _mcp_config_watcher as background task
- GatewayRunner._mcp_config_watcher(): async background task that:
  - Uses mtime fast-path to avoid unnecessary YAML reads
  - Deep-compares mcp_servers dict to detect header changes
  - Runs shutdown/discover in executor to avoid blocking event loop
  - Sleeps in 1s increments for responsive shutdown
  - 30s initial delay to let startup finish

Tests: 7 new tests covering no-change skip, header change detection,
non-MCP change skip, server add/remove, shutdown behavior, and
full integration test.
2026-04-12 07:03:50 +00:00
..
acp fix(acp): declare session load and resume capabilities in initialize response (#6985) 2026-04-10 03:45:36 -07:00
agent feat: /compress <focus> — guided compression with focus topic (#8017) 2026-04-11 19:23:29 -07:00
cli fix(cli): restore stacked tool progress scrollback in TUI (#8201) 2026-04-11 23:22:34 -07:00
cron feat(cron): support Discord thread_id in deliver targets 2026-04-10 03:20:05 -07:00
e2e refactor: extract shared helpers to deduplicate repeated code patterns (#7917) 2026-04-11 13:59:52 -07:00
environments/benchmarks fix(security): consolidated security hardening — SSRF, timing attack, tar traversal, credential leakage (#5944) 2026-04-07 17:28:37 -07:00
fakes fix: streaming tool call parsing, error handling, and fake HA state mutation 2026-03-14 14:27:20 +03:00
gateway feat(gateway): auto-reload MCP connections on config change 2026-04-12 07:03:50 +00:00
hermes_cli feat: add hermes backup and hermes import commands (#7997) 2026-04-11 19:15:50 -07:00
honcho_plugin feat(honcho): add opt-in initOnSessionStart for tools mode and respect explicit peerName (#6995) 2026-04-11 00:43:27 -07:00
integration refactor: remove mini-swe-agent dependency — inline Docker/Modal backends (#2804) 2026-03-24 07:30:25 -07:00
plugins feat(hindsight): feature parity, setup wizard, and config improvements 2026-04-08 23:54:15 -07:00
run_agent refactor: remove budget warning injection system (dead code) 2026-04-11 16:56:33 -07:00
skills fix: update tests for gws migration 2026-04-09 14:28:35 -07:00
tools perf(ssh,modal): bulk file sync via tar pipe and tar/base64 archive (#8014) 2026-04-12 06:18:05 +05:30
__init__.py A bit of restructuring for simplicity and organization 2025-10-01 23:29:25 +00:00
conftest.py fix(tests): fix several failing/flaky tests on main (#6777) 2026-04-09 13:17:06 -07:00
run_interrupt_test.py fix: thread safety for concurrent subagent delegation (#1672) 2026-03-17 02:53:33 -07:00
test_batch_runner_checkpoint.py fix: sanitize chat payloads and provider precedence 2026-03-13 23:59:12 -07:00
test_cli_file_drop.py fix(gateway): reject file paths in get_command() + file-drop tests (#7356) 2026-04-10 13:06:02 -07:00
test_cli_skin_integration.py fix: CLI/UX batch — ChatConsole errors, curses scroll, skin-aware banner, git state banner (#5974) 2026-04-07 17:59:42 -07:00
test_ctx_halving_fix.py fix(compaction): don't halve context_length on output-cap-too-large errors 2026-04-09 11:27:41 -07:00
test_evidence_store.py feat: add OSS Security Forensics skill (Skills Hub) (#1482) 2026-03-15 21:59:53 -07:00
test_hermes_constants.py fix: profile paths broken in Docker — profiles go to /root/.hermes instead of mounted volume (#7170) 2026-04-10 05:53:10 -07:00
test_hermes_logging.py feat: component-separated logging with session context and filtering (#7991) 2026-04-11 17:23:36 -07:00
test_hermes_state.py fix(state): orphan children instead of cascade-deleting in prune/delete (#6513) 2026-04-09 02:41:56 -07:00
test_honcho_client_config.py feat(memory): pluggable memory provider interface with profile isolation, review fixes, and honcho CLI restoration (#4623) 2026-04-02 15:33:51 -07:00
test_ipv4_preference.py feat: add network.force_ipv4 config to fix IPv6 timeout issues (#8196) 2026-04-11 23:12:11 -07:00
test_mcp_serve.py feat: add MCP server mode — hermes mcp serve (#3795) 2026-03-29 15:47:19 -07:00
test_minisweagent_path.py chore: remove all remaining mini-swe-agent references 2026-03-24 08:19:23 -07:00
test_model_picker_scroll.py fix: CLI/UX batch — ChatConsole errors, curses scroll, skin-aware banner, git state banner (#5974) 2026-04-07 17:59:42 -07:00
test_model_tools.py Add request-scoped plugin lifecycle hooks 2026-04-05 23:31:29 -07:00
test_model_tools_async_bridge.py fix: use per-thread persistent event loops in worker threads 2026-03-20 15:41:06 -04:00
test_ollama_num_ctx.py fix: provider/model resolution — salvage 4 PRs + MiniMax aux URL fix (#5983) 2026-04-07 22:23:28 -07:00
test_packaging_metadata.py chore: prepare Hermes for Homebrew packaging (#4099) 2026-03-30 17:34:43 -07:00
test_project_metadata.py refactor(matrix): swap matrix-nio for mautrix-python dependency 2026-04-10 21:15:59 -07:00
test_retry_utils.py feat(agent): add jittered retry backoff 2026-04-08 00:41:36 -07:00
test_sql_injection.py fix(security): eliminate SQL string formatting in execute() calls 2026-03-19 15:16:35 +01:00
test_subprocess_home_isolation.py fix: per-profile subprocess HOME isolation (#4426) (#7357) 2026-04-10 13:37:45 -07:00
test_timezone.py fix: remove 115 verified dead code symbols across 46 production files 2026-04-10 03:44:43 -07:00
test_toolset_distributions.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_toolsets.py fix: add missing Platform.SIGNAL to toolset mappings, update test + config docs 2026-03-09 23:27:19 -07:00
test_trajectory_compressor.py fix: URL-based auth for third-party Anthropic endpoints + CI test fixes (#4148) 2026-03-30 20:36:56 -07:00
test_trajectory_compressor_async.py fix: create AsyncOpenAI lazily in trajectory_compressor to avoid closed event loop (#4013) 2026-03-30 13:16:16 -07:00
test_utils_truthy_values.py Gate tool-gateway behind an env var, so it's not in users' faces until we're ready. Even if users enable it, it'll be blocked server-side for now, until we unlock for non-admin users on tool-gateway. 2026-03-30 13:28:10 +09:00