Skip to content

[Feature]: Structured handoff payload for delegate_task so children don't re-explore #9555

@easyvibecoding

Description

@easyvibecoding

Problem

When an orchestrator delegates a task via delegate_task, today the child receives goal and context as strings in its system prompt. Everything the parent already learned about the task — which files it read, which commands it ran, what error messages it saw — gets discarded. The child has to re-explore from scratch.

In the delegation benchmark we ran on the Hermes / hermes-sci stack (MiniMax-M2.7 orchestrator + claude -p worker), this re-exploration was the single largest source of latency for medium tasks. Example trace shape from the eval:

parent:  read_file src/X.py → saw import error
parent:  grep for Y → found 3 call sites
parent:  delegate_task(goal="fix the import")   ← child starts blind
child :  read_file src/X.py                     ← repeat
child :  grep for Y                             ← repeat
child :  … then fix

On unfamiliar-repo tasks the child can spend 30-60s re-doing exploration the parent just did.

Proposal

Extend delegate_task with a structured handoff payload (optional, orchestrator-built), not just free-text context:

delegate_task(
    goal="fix the failing type in src/X.py:42",
    handoff={
        "read_files":  ["src/X.py", "src/Y.py"],     # child should hydrate these without re-reading
        "ran_commands":[{"cmd":"pytest -k X","rc":1,"tail":"<last 400 lines>"}],
        "probe_results":{"grep Y":"3 hits in src/"},
        "dead_ends":  ["tried monkey-patching at module level, reverted"],
    },
)

Child's sandbox is pre-populated with:

  • File contents cached so the first read_file on a handoff path is a local hit, not a disk read
  • Command results preloaded into the child's tool-history so it won't re-run them
  • dead_ends surfaced as a "don't retry" note in the child's system prompt

Why it matters

Scope / non-goals

  • This is about one-shot synchronous delegation (delegate_task). Persistent subagents (Persistent ACP background subagents #4949) solve a different problem (long-lived workers); a warm subagent already has its own running context.
  • Serialization surface: the orchestrator is responsible for pruning handoff to fit the child's context window. A safe default is "last N file reads + last K commands + goal-adjacent grep hits," trimmed to e.g. 20-30% of the child's context budget.
  • Doesn't require changes to worker backends — a single system-prompt block with context-dump fences is enough to start; richer tool-history preload can follow.

Evidence

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havetool/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