Fixes #1036 After adding an MCP server to config.yaml, users had to restart Hermes before the new tools became visible — even though /reload-mcp existed. Add _check_config_mcp_changes() called from process_loop every 5s: - stat() config.yaml for mtime changes (fast path, no YAML parse) - On mtime change, parse and compare mcp_servers section - If mcp_servers changed, auto-trigger _reload_mcp() and notify user - Skip check while agent is running to avoid interrupting tool calls - Throttled to CONFIG_WATCH_INTERVAL=5s to avoid busy-polling /reload-mcp still works for manual force-reload. Tests: 6 new tests in TestMCPConfigWatch, all passed Co-authored-by: teyrebaz33 <hakanerten02@hotmail.com>
264 KiB
Executable File
264 KiB
Executable File