Conversation
--print/--json cannot re-invoke after agent_settled, so spawn text that tells the model to end the turn drops required child results. Require subagent_wait on non-TUI hosts and send a bounded follow-up barrier.
Correct E-06..10 as pre-fix, point at bun/unit logs and hang issue #516, and keep the reliability notes from being read as a Benchmark.
tt-a1i
left a comment
There was a problem hiding this comment.
Self-review at exact head a10103d. I cannot formally request changes on a PR authored by this account, but the following are merge-blocking.
Standards
[P1] Print-host completion is still prompt-enforced rather than runtime-enforced. The agent_settled handler injects at most two “MUST call subagent_wait” follow-ups and then allows settlement while children may still run. The 10/10 experiment validates that the improved spawn wording influences this model; it does not establish a fail-closed lifecycle barrier.
[P1] runningDirectIds duplicates manager lifecycle state and misses valid transitions. A fast child can settle before the ID is added after spawn, leaving a stale running ID; a settled child restarted through subagent_send is never re-added. Please derive this state from the manager rather than maintaining a parallel Set.
Spec
[P1] Restarted direct children receive neither print-host wait guidance nor barrier tracking, so their required result can still be lost when the parent exits.
[P1] The fallback calls fire-and-forget pi.sendMessage() from agent_settled. Pi print mode can finish the original prompt and dispose before that nested turn completes; current tests assert pure helpers and the experiment runs all obeyed the earlier spawn guidance, so the fallback path has no end-to-end evidence.
[P2] The barrier counter is Session-global and never resets per spawn/batch, and RPC is included without protocol-level validation. The draft research records are also indexed under “Validated investigations.”
tt-a1i
left a comment
There was a problem hiding this comment.
审查提交:a10103da192b64d9d00e297a361ba9d396e4ec1f。
需要修改后再合并。
具体问题
P1 — 两次提示不能形成 print-host 生命周期屏障 · extensions/subagents/index.ts:566
agent_settled injects at most two follow-ups then returns regardless of running children; sendMessage is fire-and-forget. Prompt adherence samples cannot prove settlement waits.
P1 — runningDirectIds 与实际子代理状态分离 · extensions/subagents/index.ts:1070
Set insertion happens after spawn; onSettled can run before insertion. subagent_send restart has no corresponding insertion, so restarted children are not tracked.
验证范围
Full production diff and research/test changes inspected for evidence scope; same head as previous self-review and both lifecycle defects still present.
限制与后续
No live model call or fallback print end-to-end run. Existing 10/10 experiment is prompt-following evidence only. Research records marked draft must not be indexed as validated.
Summary
--print/--mode jsoncannot re-invoke the parent afteragent_settled. Stock spawn text still tells the model it may end the turn; required child results are lost (E high-fast 3/10 print-settle failures).subagent_wait, plus a boundedfollowUp+triggerTurnbarrier if the parent settles while direct children are running. Interactive TUI guidance is unchanged.cursor-grok-4.6-high-fast: 7/10 before (v0.8.1 stock) → 10/10 after. Isolatedbun run checkandbun run testpass. Closes nothing; tracks bug(subagents): --print/--json parent can settle while required children are still running [under investigation] #512. Do not merge from this reliability session unless a maintainer asks.Test plan
tests/extensions/subagents/print-host.test.tsand prompt contractbun run check&&bun run testin isolated v0.8.1 worktree