Skip to content

orchestrate: a subagent definition written mid-session resolves to a generic agent and reports the spawn as successful #389

Description

@rodrigorjsf

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

Symptom

The orchestrator wrote two probe subagent definitions to .claude/agents/ and immediately spawned them by their declared name. Both spawns returned Spawned successfully. Both agents came up:

  • without the definition's body as their system prompt — one probe reported that the only thing in its context was the spawn prompt; and
  • without the definition's tools: restriction — one reported it had SendMessage despite tools: Write.

The registry picked the files up only afterwards, at which point the harness announced New agent types are now available and named both.

Why it matters here

This is the same silent-substitution class the plugin already worries about elsewhere: a spawn that reports success while the agent that comes up is not the agent that was asked for. Neither the declared body nor the declared skills: preload took effect, and nothing said so.

An orchestrator that did not happen to ask the probe to self-report its own system prompt would have read its output as a valid result.

Consequence for the run

Both probe results had to be discarded and the probes re-spawned after registration. Had this happened to a slice role rather than a throwaway probe, the orchestrator would have consumed a full implementer or reviewer pass on an agent with the wrong tools and no role instructions — and the envelope-validation chain would not necessarily have caught it, because a generic agent can still emit a well-formed envelope.

Workaround used

Re-spawn after the New agent types are now available notice appeared.

Suggested fix

This is a harness-level behaviour rather than a plugin defect, so the plugin-side mitigation is documentation: the spine should state that

  • agent definitions created during a session are not spawnable until the registry refreshes, and
  • a spawn by an unregistered type resolves to a default agent rather than erroring.

Upstream, the correct behaviour is to fail the spawn with an unknown-agent-type error instead of silently substituting.

Scope note — what this issue is and is not about

The missing system prompt / body and the silent success are this issue's payload. The missing tool restriction is reported here as one symptom of the same unregistered-type substitution; the separate question of whether an explicit tools: list is reliably enforced for a properly registered plugin subagent is filed on its own (see the no-Bash-sandbox issue from this run) and should not be folded in here.

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. Claude Code on WSL2.

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