Skip to content

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

Open

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

  1. added
    bugSomething isn't working
    area:subagentsSubagent delegation, skills, or tests
    on Sep 8, 2026
  2. tt-a1i commented on Sep 8, 2026

    @tt-a1i
    CollaboratorAuthor

    Isolated worktree now has a failing-repro-first helper plus wiring (not merged):

    • extensions/subagents/src/print-host.ts — TUI-only canDeliverLater, pending follow-up text
    • buildSubagentSpawnResult({ canDeliverLater: false }) requires subagent_wait and does not say “end your turn”
    • --print/json/rpc parent agent_settled with running direct children sends up to two followUp + triggerTurn barriers

    Unit tests: tests/extensions/subagents/print-host.test.ts and the new prompt contract. Same E task+acceptor has 10 before-samples on v0.8.1 stock spawn text (3 print-settle failures, 7 waits). After-sample revalidation is in progress. No merge/release.

  3. tt-a1i commented on Sep 8, 2026

    @tt-a1i
    CollaboratorAuthor

    Before/after on the same E task+acceptor, cursor-grok-4.6-high-fast, isolated v0.8.1:

    • Before (stock spawn text): 7/10 correct, 3/10 print-settle wrong result (attempts 01–10).
    • After (print-host spawn text + bounded follow-up barrier): 10/10 correct (attempts 11–20). E-11 spawn result includes You MUST call subagent_wait and the model called Pi subagent_wait.

    PR opened from research/openpi-cursor-reliability-20260908. Isolated bun run check + bun run test green. Not merged.

  4. added a commit that references this issue on Sep 8, 2026
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