Skip to content

orchestrate: a subagent has no channel to deliver its result envelope when the Agent spawn returns only spawn metadata #383

Description

@rodrigorjsf

Found during orchestrate run prd352-20260803-015333 (PRD #352, 12 slices, all passed).

Symptom

Agent(subagent_type: "orchestrate:implementer-standard", run_in_background: false) returned only spawn metadata (agent_id, "the agent is now running") — never the subagent's final text. The subagent then emitted two idle_notification events with no payload. The orchestrator therefore never received the text that validate_envelope requires as its text argument.

Why it is unrecoverable by design

The four orchestrate subagents are deliberately sandboxed to Read, Edit, Write, Grep, Glob plus the capability tools — no Bash, no git, and no SendMessage. So a subagent that has already ended its turn has no channel to deliver its envelope to the orchestrator.

TaskOutput is documented as unsafe for local_agent tasks: the .output path is a symlink to the full conversation JSONL and would overflow the orchestrator's context — the exact resource the plugin's whole delegation design is trying to conserve.

Impact

The entire result-envelope trust chain — the plugin's core correctness mechanism — depends on a return value the harness does not guarantee is delivered. Every slice is exposed. The orchestrator cannot fall back to reading the worktree, because the spine explicitly forbids determining status from anything but the validated envelope.

Workaround used

SendMessage to the still-resident subagent asking it to Write the envelope verbatim to a known absolute path, then Read it back and pass the file content to validate_envelope. This works because the subagent retains Write, and because validate_envelope locates the fenced block within the supplied text.

Suggested fix

Make the envelope's durability a property of the protocol rather than of the return value: have every orchestrate subagent write its envelope to .orchestrate/runs/<runId>/envelopes/<role>-<sliceId>.md as its final action, and have the orchestrator read that file as the primary source, treating the Agent return text as a fast path only.

That also makes the envelope survive a mid-slice context handoff, which the return value never can.

Relationship to existing issues (read before deduping)

Environment

orchestrate 1.6.0 (plugins/orchestrate/.claude-plugin/plugin.json:3 on development) plus the PRD #352 umbrella branch (slice-executor delegation layer). Run prd352-20260803-015333.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions