Skip to content

Add durable profile-agent orchestration via agent_control#18493

Closed
dodo-reach wants to merge 1 commit into
NousResearch:mainfrom
dodo-reach:codex/agent-control-orchestration
Closed

Add durable profile-agent orchestration via agent_control#18493
dodo-reach wants to merge 1 commit into
NousResearch:mainfrom
dodo-reach:codex/agent-control-orchestration

Conversation

@dodo-reach

@dodo-reach dodo-reach commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds agent_control: a durable orchestration layer that lets Hermes profiles manage other Hermes profiles as persistent peer agents over ACP.

The core idea is simple: delegate_task is for disposable subagents, Kanban is for asynchronous task-board workflows, and agent_control is for direct manager/team orchestration. A Hermes orchestrator can now command named specialist profiles with their own memory, tools, skills, config, and resumable session history.

This turns Hermes profiles into composable agent teammates without inventing a separate swarm runtime. It reuses the primitives Hermes already trusts: profiles for identity, ACP for process/session control, toolsets for capability boundaries, and SQLite for durable state.

This builds on the external orchestration direction from #14009, but moves the control plane into Hermes as an opt-in toolset designed for production reliability.

What changed

  • Add a lightweight ACP stdio JSON-RPC client for Hermes profile sessions.
  • Add a durable SQLite-backed control plane for profile-agent handles, runs, and leases.
  • Add the agent_control toolset and tools:
    • agent_start
    • agent_prompt
    • agent_status
    • agent_list
    • agent_fork
  • Keep editor ACP behavior unchanged by default.
  • Allow agent-control ACP subprocesses to use the controlled profile's CLI toolsets.
  • Prevent delegate_task children from inheriting agent_control.
  • Keep dangerous permission approval policy outside the model-facing schema; trusted local automation can opt into one-shot approvals only via process/admin configuration.
  • Omit model-facing cancellation until Hermes has an async or pollable run API with ACP response dispatching strong enough to cancel in-flight work reliably.
  • Add user docs and an ADR comparing delegate_task, agent_control, and Kanban.
  • Convert the existing Kanban architecture diagram to Mermaid so docs diagram lint stays green when website docs are touched.

Reliability notes

  • SQLite session leases are keyed by (profile, session_id), so duplicate handles or separate orchestrator profiles cannot race the same ACP session history.
  • agent_fork takes the same source-session lease before branching history.
  • Expired leases are marked as errors instead of leaving handles stuck.
  • Existing ACP sessions are loaded strictly; missing sessions fail instead of silently creating ghost state.
  • Dangerous permission requests fail closed by default.
  • The model cannot set approval_policy="allow_once" through tool arguments; permissive behavior requires HERMES_AGENT_CONTROL_APPROVAL_POLICY=allow_once.
  • agent_control is gated on the ACP extra.

Tests

  • .venv/bin/python -m pytest tests/acp/test_client.py tests/agent/test_orchestration.py tests/acp/test_session.py tests/tools/test_delegate.py tests/tools/test_registry.py::TestBuiltinDiscovery::test_matches_previous_manual_builtin_tool_set -q
    • 190 passed
  • .venv/bin/python -m compileall acp_adapter/client.py acp_adapter/session.py agent/orchestration.py tools/agent_control_tool.py hermes_cli/tools_config.py tests/acp/test_client.py tests/acp/test_session.py tests/agent/test_orchestration.py tests/tools/test_delegate.py tests/tools/test_registry.py
  • agent_control registry smoke check
  • agent_control toolset smoke check
  • .venv/bin/ascii-guard lint website/docs
  • npm run build
    • completed successfully with the venv Python on PATH so the skill metadata prebuild matches CI's pyyaml setup.
  • git diff --check

The targeted test set covers the new ACP client, the durable orchestration control plane, ACP toolset behavior, and the regression that prevents delegate_task children from inheriting agent_control. The full repository suite is left to CI.

@dodo-reach dodo-reach force-pushed the codex/agent-control-orchestration branch from 4b3f556 to 5dcf829 Compare May 1, 2026 18:01
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/acp Agent Communication Protocol adapter comp/agent Core agent loop, run_agent.py, prompt builder comp/tools Tool registry, model_tools, toolsets tool/delegate Subagent delegation labels May 1, 2026
@dodo-reach dodo-reach force-pushed the codex/agent-control-orchestration branch from 5dcf829 to 76f1873 Compare May 1, 2026 18:36
@flooryyyy

Copy link
Copy Markdown
Contributor

@dodo-reach is this closed on purpose? any plans to work upon this further?

@ariccb

ariccb commented Jun 8, 2026

Copy link
Copy Markdown

Also wondering what the status of this is - sounds like the ideal setup honestly.
I came here from https://www.reddit.com/r/hermesagent/comments/1ss20t0/you_can_have_one_main_hermes_profile_orchestrate/

@dodo-reach

dodo-reach commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Restored this work in a new PR: #43030 The original source branch/fork had been deleted, and GitHub would not reopen this PR after recreating the branch, so I recreated the fork branch from the preserved PR ref and opened the replacement PR above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter comp/agent Core agent loop, run_agent.py, prompt builder comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants