hermes-agent/tests
teknium1 b159002078 feat: multi-agent architecture — named agents with routing, tool policies, and isolated workspaces
Implements the full multi-agent system for Hermes Agent, allowing a single
installation to host multiple named agents, each with its own model,
personality, toolset, workspace, and session history.

## New Files

- gateway/agent_registry.py: AgentConfig, ToolPolicy, SubagentPolicy,
  AgentRegistry, TOOL_PROFILES (minimal/coding/messaging/full), and
  normalize_tool_config() for shorthand YAML parsing

- gateway/router.py: BindingRouter with 7-tier deterministic routing
  (chat_id > peer > guild+type > guild > platform+type > platform > default)

## Core Changes

- model_tools.py: get_tool_definitions() accepts agent_tool_policy for
  per-agent tool filtering; handle_function_call() extended enabled_tools
  check to gate ALL tool calls (defense-in-depth)

- gateway/session.py: build_session_key() now accepts agent_id and dm_scope
  parameters, replacing hardcoded 'agent:main' with 'agent:{agent_id}'

- tools/memory_tool.py: MemoryStore accepts memory_dir parameter for
  per-agent memory isolation

- agent/prompt_builder.py: build_context_files_prompt() accepts
  agent_workspace for SOUL.md lookup; build_skills_system_prompt()
  accepts agent_skills_dir for per-agent skill overlay

- run_agent.py: AIAgent accepts agent_tool_policy and agent_workspace,
  passes policy through to get_tool_definitions()

- gateway/run.py: Initializes AgentRegistry + BindingRouter, resolves
  agent per-message in _handle_message(), passes config to _run_agent(),
  adds /agents command

- cli.py: --agent flag for selecting named agent profiles, /agents
  slash command, agent config override for model/personality/tools

- hermes_cli/config.py: agents/bindings in DEFAULT_CONFIG, version 7

- tools/delegate_tool.py: Configurable max_depth per-agent, tool policy
  inheritance from parent to child

## Config Format

agents:
  main:
    default: true
  coder:
    model: anthropic/claude-sonnet-4
    personality: 'You are a coding assistant.'
    tools: coding  # or [tool1, tool2] or {profile: x, deny: [...]}

bindings:
  - agent: coder
    telegram: '-100123456'

## Tests

168 new tests across 3 test files (agent_registry, router, integration).
All 3106 tests pass.
2026-03-11 03:21:12 -07:00
..
agent Merge: vision auto-detection fallback to local endpoints 2026-03-09 15:36:27 -07:00
cron fix: log prefill parse errors + clean up cron scheduler tests 2026-03-10 17:10:01 -07:00
fakes test: add HA integration tests with fake in-process server 2026-02-28 14:28:04 +03:00
gateway feat: multi-agent architecture — named agents with routing, tool policies, and isolated workspaces 2026-03-11 03:21:12 -07:00
hermes_cli feat: multi-agent architecture — named agents with routing, tool policies, and isolated workspaces 2026-03-11 03:21:12 -07:00
honcho_integration Merge PR #193: add unit tests for 5 security/logic-critical modules (batch 4) 2026-03-04 19:35:01 -08:00
integration chore: remove all NOUS_API_KEY references 2026-03-08 17:45:38 -07:00
skills feat: expand OpenClaw migration to cover all platform channels, provider keys, model/TTS config, shared skills, and daily memory 2026-03-10 00:35:14 -07:00
tools test: add tests for subagent model config override 2026-03-10 23:48:55 -07:00
__init__.py A bit of restructuring for simplicity and organization 2025-10-01 23:29:25 +00:00
conftest.py fix(tests): isolate HERMES_HOME in tests and adjust log directory for debug session 2026-03-02 04:34:21 -08:00
test_413_compression.py fix: rebuild compressed payload before retry 2026-03-07 18:55:01 -05:00
test_860_dedup.py fix: eliminate 3x SQLite message duplication in gateway sessions (#860) 2026-03-10 15:22:44 -07:00
test_api_key_providers.py fix: add Kimi Code API support (api.kimi.com/coding/v1) 2026-03-07 21:00:12 -05:00
test_atomic_json_write.py refactor: extract atomic_json_write helper, add 24 checkpoint tests 2026-03-06 05:50:12 -08:00
test_auth_codex_provider.py refactor(auth): transition Codex OAuth tokens to Hermes auth store 2026-03-01 19:59:24 -08:00
test_auth_nous_provider.py Fix nous refresh token rotation failure in case where api key mint/retrieval fails 2026-03-02 17:18:15 +11:00
test_auxiliary_config_bridge.py fix: harden auxiliary model config — gateway bridge, vision safety, tests 2026-03-08 18:06:47 -07:00
test_batch_runner_checkpoint.py refactor: extract atomic_json_write helper, add 24 checkpoint tests 2026-03-06 05:50:12 -08:00
test_cli_init.py fix: normalize max turns config path 2026-03-10 06:05:02 -07:00
test_cli_loading_indicator.py fix(cli): add loading indicators for slow slash commands 2026-03-10 17:31:00 -07:00
test_cli_model_command.py fix: improve /model user feedback + update docs 2026-03-08 06:13:12 -07:00
test_cli_provider_resolution.py fix: trust user-selected models with OpenAI Codex provider 2026-03-08 18:29:09 -07:00
test_codex_execution_paths.py feat: simple fallback model for provider resilience 2026-03-08 20:22:33 -07:00
test_codex_models.py Merge pull request #735 from NousResearch/hermes/hermes-f8d56335 2026-03-08 18:30:27 -07:00
test_display.py fix: add upstream guard for non-dict function_args + tests for build_tool_preview 2026-03-09 21:01:40 -07:00
test_external_credential_detection.py refactor(auth): transition Codex OAuth tokens to Hermes auth store 2026-03-01 19:59:24 -08:00
test_fallback_model.py refactor: unified OAuth/API-key credential resolution for fallback 2026-03-08 21:44:48 -07:00
test_flush_memories_codex.py refactor(cli): Finalize OpenAI Codex Integration with OAuth 2026-02-28 21:47:51 -08:00
test_hermes_state.py Merge PR #565: fix: sanitize FTS5 queries and close mirror DB connections 2026-03-09 23:59:26 -07:00
test_honcho_client_config.py fix(honcho): auto-enable when API key is present 2026-03-01 03:12:37 -05:00
test_insights.py fix: deep review — prefix matching, tool_calls extraction, query perf, serialization 2026-03-06 14:50:57 -08:00
test_model_provider_persistence.py fix: provider selection not persisting when switching via hermes model 2026-03-10 17:12:34 -07:00
test_model_tools.py test: strengthen assertions across 3 more test files (batch 2) 2026-03-05 18:46:30 -08:00
test_provider_parity.py feat: default reasoning effort from xhigh to medium 2026-03-07 10:14:19 -08:00
test_resume_display.py feat: display previous messages when resuming a session in CLI 2026-03-08 17:45:45 -07:00
test_run_agent.py fix: wire up enabled_tools in agent loop + simplify sandbox tool selection 2026-03-10 06:35:28 -07:00
test_run_agent_codex_responses.py refactor(cli): Finalize OpenAI Codex Integration with OAuth 2026-02-28 21:47:51 -08:00
test_runtime_provider_resolution.py fix: provider selection not persisting when switching via hermes model 2026-03-10 17:12:34 -07:00
test_timezone.py fix(timezone): add timezone-aware clock across agent, cron, and execute_code 2026-03-03 18:23:40 +05:30
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 test: add 25 unit tests for trajectory_compressor 2026-02-28 21:28:28 +03:00
test_worktree.py fix: wire worktree flag into hermes CLI entry point + docs + tests 2026-03-07 21:05:40 -08:00