Skip to content

autoplan: "Run them simultaneously" causes Agent tool subagents to be abandoned #497

Description

@ConejoCapital

Bug Description

The /autoplan dual-voice feature instructs Claude to run the Agent tool (subagent) and Bash (Codex) simultaneously, with "All non-blocking" error handling. This causes every autoplan invocation to silently degrade to single-reviewer mode.

Root Cause

Two independent failure modes:

1. Permission Isolation (Critical)

Background subagents dispatched with run_in_background: true do NOT inherit the parent session's tool permissions. Both Read and Bash tools are denied. The subagent literally cannot read files or run commands — it's dead on arrival.

Tested output from background subagent:
```
status: completed
result: "I cannot complete this task. Both the Read and Bash tools have
been denied permission, preventing me from accessing the file..."
tool_uses: 2
duration_ms: 5898
```

2. Timing Race

Even if permissions worked, background task output arrives as a `` after the blocking Bash call returns. Claude has already moved on to present the consensus table, so subagent output is orphaned.

Tested foreground subagent (same prompt — works correctly):
```
Result: "SUBAGENT_COMPLETE: Line 198 specifies that dual voice reviews
(Claude subagent and Codex) must execute simultaneously..."
tool_uses: 1
duration_ms: 5857
```

Affected Lines

`autoplan/SKILL.md.tmpl` (source of truth):

  • Line 198: `Run them simultaneously (Agent tool for subagent, Bash for Codex).`
  • Line 220: `Error handling: All non-blocking.`
  • Line 241: `Step 0.5 (Dual Voices): Run Claude subagent AND Codex simultaneously.`
  • Line 341: `Step 0.5 (Dual Voices): Run Claude subagent AND Codex simultaneously.`
  • Line 409: `Step 0.5 (Dual Voices): Run Claude subagent AND Codex simultaneously.`

Same text propagates to generated `autoplan/SKILL.md` at lines 541, 563, 584, 684, 752.

Reproduction

  1. Run `/autoplan` on any plan file
  2. Observe Claude launches a background Task and a Bash call in parallel
  3. Background Task fails with permission denied OR completes after Claude has moved on
  4. Consensus table shows N/A for the subagent voice
  5. Degradation matrix triggers "single-reviewer mode" silently

Impact

  • Every `/autoplan` invocation degrades to single-reviewer mode
  • The dual-voice feature (a key differentiator) never actually works
  • No error is surfaced — the degradation matrix masks the systematic failure
  • Users see the consensus table but subagent voice is always missing

Proposed Fix

Change "simultaneously" → sequential dispatch:

  1. Run Claude subagent via Agent tool in foreground (blocks, inherits permissions)
  2. Run Codex via Bash (blocks)
  3. Both outputs available → build real consensus table

Change "All non-blocking" → "Agent tool blocks in foreground; Codex blocks via Bash."

PR incoming: #fix/autoplan-subagent-parallelization

Environment

  • Claude Code with Opus 4.6
  • gstack v0.11.18.2
  • macOS Darwin 25.3.0

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions