Skip to content

Persistent ACP background subagents #4949

@malaiwah

Description

@malaiwah

Summary

Add long-lived sandboxed ACP subagents to Hermes so work can continue across turns instead of forcing everything through synchronous delegate_task runs.

Motivation

Today Hermes subagents are one-shot and synchronous:

  • start a sandbox
  • run the child task
  • wait for the final summary
  • tear it down

That works for bounded delegation, but it blocks longer-running agent workflows where Hermes should be able to:

  • start a coding/research subagent and move on
  • see which background agents are still open on later turns
  • send follow-up instructions later
  • poll buffered progress/output
  • get nudged when a background agent finishes or dies

Proposed behavior

  • Keep delegate_task unchanged.
  • Add explicit background-subagent tools:
    • spawn_background_subagent
    • list_background_subagents
    • send_background_subagent
    • poll_background_subagent
    • get_background_subagent_status
    • stop_background_subagent
  • Run each background subagent as one persistent ACP peer session inside one Hermes-managed sandbox container.
  • Show the parent agent, every turn, which background subagents are still open, their purpose, cwd, status, and unread output count.
  • Buffer ACP updates until the parent explicitly polls them.
  • Enforce an idle timeout and an absolute max lifetime.
  • Send a hidden nudge on the next parent turn when a subagent finishes, times out, errors, or loses its channel.

Design notes

  • ACP-first, standards-compliant over stdio JSON-RPC.
  • One live ACP session per sandbox container.
  • In-memory only for v1; no restart reattachment.
  • Primary target is opencode acp.
  • Keep the runtime extensible for future Hermes-to-Hermes ACP and gated reverse requests from child to parent.

Related work

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/acpAgent Communication Protocol adaptercomp/agentCore agent loop, run_agent.py, prompt buildertool/delegateSubagent delegationtype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions