Skip to content

bug(subagents): --print/--json parent can settle while required children are still running [under investigation] #512

Description

@tt-a1i

Status

Wiring landed on research branch research/openpi-cursor-reliability-20260908 @ 7950570 and PR #515. PR is not merged. Isolated evidence only. Not a formal Benchmark.

Impact

In pi --print / --mode json, a parent that calls subagent_spawn and then ends the turn emits agent_settled and the process exits. Automatic result delivery only helps an interactive TUI. Required child results are lost.

Evidence — same E task+acceptor, cursor-grok-4.6-high-fast

Receipts still say source=a3edee28 because the harness hardcoded that SHA. Split is by spawn-result text + attempt window. Index: /tmp/openpi-reliability-20260908/results/e-high-fast-512-version-split.md.

Window Product behavior n Correct
E-01..10 stock v0.8.1 spawn (“end your turn” / auto re-invoke). E-06..10 are still this window, not after-fix. 10 7
E-11..20 print-host spawn from 7950570 (“MUST call subagent_wait”). All 10 stdout traces show that text. 10 10

E-01 spawn result (trimmed): “end your turn; its result is delivered automatically and you are automatically re-invoked”. E-11 spawn result: “This host cannot re-invoke you after you end the turn. You MUST call subagent_wait…”

Isolated bun run check exit 0 (results/isolated-bun-check.log) and bun run test exit 0, 1470 pass (results/isolated-bun-test.log).

Fix (on the research branch only)

  • buildSubagentSpawnResult({ canDeliverLater: false }) requires wait and does not say “end your turn”.
  • On agent_settled, if the host cannot deliver later and direct children are still running, send up to two followUp + triggerTurn barriers.

Do not disable tools, loosen permissions, or lengthen timeouts.

Applicability

OpenPI v0.8.1 subagent spawn/delivery. Not Cursor native-tool rejection (PR #484). Related hung-after-success: #516.

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

    area:subagentsSubagent delegation, skills, or testsbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions