Skip to content

Delegation framework (HierarchicalAgent/DelegateTool) is unwired — no production caller #11207

Closed

Description

@mrveiss

Discovered during #11159 investigation.

Problem

The hierarchical delegation framework is fully scaffolded but has no production caller:

  • agents/hierarchical_agent.py HierarchicalAgent — only instantiated within its own _create_subordinate (and a docstring example); nothing constructs a root and runs it.
  • tools/delegate_tool.py DelegateTool — returns {"error": "no_hierarchical_agent"} unless injected with a HierarchicalAgent, and nothing injects one.
  • chat_workflow/models.py AgentContext.create_subordinate_context / create_child — zero production callers.
  • The delegate tool in chat_workflow/tool_handler.py only records pending_delegation; nothing consumes it to spawn a subagent.

So delegated multi-agent execution does not happen in production, and governance keyed on a subagent identity (#11159) has nothing to bind to.

Action

Decide: wire the delegation framework into a real execution path, or remove it as dead scaffolding. If wired, stamp the subordinate AgentContext.agent_id with a governed profile id so #11145 forbidden_work enforcement applies to delegated work.

Related: same "wired-but-never-triggered" pattern as AgentLoop (see #11145/#11175) and the dormant chat approval-interrupt (#11202).

Activity

  1. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    PR #11215 (merged to Dev_new_gui) references this issue with a close keyword.

    feat(delegation): add governed internal-LLM engine, provider-agnostic runner (#11207)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on Jul 7, 2026

    @mrveiss
    OwnerAuthor

    Completed. The delegate tool is now wired to an isolated, provider-agnostic governed subagent runner (chat_workflow/delegation.py), flag-gated OFF by default (AUTOBOT_DELEGATION_ENABLED).

    PR1 — #11213 (sub-task #11214): runner + _ENGINES registry + claude_code engine (external autonomous agent, governed via --disallowedTools mapped from the profile's forbidden_work; _handle_delegate_tool → async generator, record-only when off).

    PR2 — #11215: internal engine (AutoBot's own LLM driving _execute_llm_continuation_loop with a governed LLMIterationContext; tools funnel through _dispatch_tool_call → _enforce_forbidden_work for free; in-process delegation_depth bounding).

    Both engines give the subordinate agent autonomy and backend-enforced oversight. Follow-up #11216 tracks moving _current_lightweight_mode onto ctx for full singleton isolation (cosmetic, latent).

    Closing as done.

  3. mrveiss commented on Sep 22, 2026

    @mrveiss
    OwnerAuthor

    Filed #17286 for the remainder: the delegate tool name was rewired to chat_workflow/delegation.py, but the two modules this issue is named after are still present with no production caller.

    HierarchicalAgent( appears only at agents/hierarchical_agent.py:57,135 (creating its own subordinates) and in agents/subordinate_delegation_test.py. tools/delegate_tool.py declares name = "delegate" (:52) and is constructed nowhere outside tests, returning "Delegation not available in current context" when its hierarchical_agent is unset.

    Per the no-deletion rule #17286 treats this as consolidation — the recursive-subordinate model has no equivalent in the live runner and should be folded in or explicitly retired, not dropped.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions