Repository navigation
fix(pstack): let Claude Code subagents wait in the foreground (#232, #233) - #239
Conversation
…233) Every generated lane agent set background: true, which Claude Code honors over a caller's run_in_background: false, so a subagent could not wait for a lane's report and polled instead. The generator drops the field. codex-tools.md now says once how the main session and a subagent wait on Claude Code, including the PR watcher, and the other files point there. The catalog live-gate case dispatches its lanes in the foreground and requires their reports inline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Queue ready pull requestsAutomatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head and every review thread is resolved.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
Live evidence: Open Pstack
|
|
[Medium impact] The change affects Claude Code users following pstack’s lane and babysit workflows. The watcher rule needs fixing before merge because it blocks a subagent’s required recheck after a blocker is fixed. FindingsSummaryRemoves forced background execution from 25 generated Claude lane agents and lets callers choose how to wait.
Acknowledged limits, not new findings:
This review used source inspection. No tests or live sessions were run. Reviews (1) · Last reviewed commit: "fix(pstack): let Claude Code subagents w..." · Reviewed by Greptile |
✅ Accepted riskAccepted by ericlitman: #232 (authority 48fa77b) 🔴 High · TIMEOUT restart loops past merge-queue readiness DetailsRun: @unfret review · @unfret status · @unfret help |
There was a problem hiding this comment.
🛑 3 blocking findings
🔴 High · The three-agent live gate requests only two calls
🔴 High · TIMEOUT-only restart strands babysit after a blocker
🟡 Medium · Origin subagents are routed to the GitHub-only watcher
Check
The wait rule let a subagent rerun watch-pr only after a TIMEOUT exit, so after it fixed a BLOCKER (exit 3 or 4) and pushed, it stopped watching, against babysit step 6. It now reruns after a TIMEOUT and after every push or verdict it acts on, on GitHub only. The catalog case's prompt asks for all of its Agent calls, now three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live evidence: Open Pstack
|
There was a problem hiding this comment.
🛑 1 blocking finding
🔴 High · TIMEOUT restart loops past merge-queue readiness
Check
|
Operator waiver for head 2e6d2ec (#232, #233). The one open blocking finding, "TIMEOUT restart loops past merge-queue readiness", is true and not material. Class:
|
|
@Mergifyio refresh |
Merge Queue Status
This pull request spent 9 seconds in the queue, including 1 second running CI. Required conditions to merge
|
✅ Pull request refreshed |
Summary
On Claude Code, a subagent can now wait for a lane's report in the foreground. Every generated lane agent set
background: true, which Claude Code honors over a caller'srun_in_background: false, so a subagent that needed a lane's result could only poll for it.Closes #232. Closes #233.
Evidence
background: true, called withrun_in_background: false, returned "Async agent launched successfully" withis_backgrounded: true, from the main session and from a subagent at depth 2 (2026-10-20 probe, quoted on Claude lanes default to background, which forces polling when a subagent dispatches dependent work #233).--plugin-dir, a foregroundgeneral-purposesubagent dispatchedpstack:pstack-opus-lowwithrun_in_background: false:features/recipes.ts, so it runs from a checkout of this head with--self-test. Features, and why each runs:claude:catalog: its native-agents case dispatches the regenerated lane agents in the foreground and requires their reports inline.claude:skill-invocation:poteto-modeandcodex:skill-invocation:poteto-mode: one stand-in per harness for the text changes, since poteto-mode's Platform Adaptation paragraph now points to the new section.project-skillin both harnesses comes with--self-test.Merge Danger
Door: two-way
Blast Radius: dispatch
A main-session caller that omits
run_in_backgroundstill starts subagents in the background by default. A caller that asks for the foreground now gets it. The section tells the main session to passrun_in_background: truefor fan-outs.Acceptance criteria
codex-tools.md's "Waits on Claude Code", andcodex-tools.md:70andprovider-dispatch.mdpoint to it.watch-prin the foreground with Bashtimeout: 600000and--timeout 240, and reruns it after aTIMEOUTexit (5) and after every push or verdict it acts on, as babysit step 6 says. On another forge it follows that forge's commands. The 240 s window bounds one observation call; it is never a lane or runner deadline, which keepsAGENTS.md's rule against implicit runtime timeouts. Babysit step 6 says/loopapplies to the main session.Gate results
On this head:
bun run testbun run typechecktsc, three projectsbun run staticclaude plugin validate plugins/pstackbun runner/registry/render.ts --checkReview rounds
4fb19b7d), Unfret: the TIMEOUT-only rerun would strand a babysit subagent after it fixed aBLOCKER(exit 3 or 4) and pushed (verdict-changing, fixed). The catalog prompt said "both" Agent calls for three agents (fails-loudly, fixed in the same push). The watcher rule did not say it is GitHub-only (fails-loudly, fixed in the same sentence).Not verified
watch-prwait inside a subagent, or a subagent waiting on its own background lane's receipt. Those are instructions whose mechanics, the Bash timeout andwatch-pr's exit 5, already exist.watch-prchecks its deadline only before a sleep that can last 300 s, so one call can still run past 240 s. That script is upstream-derived; any change goes to cursor/plugins first.NOTICE.md's port-authored list leaves outprovider-dispatch.md.Thanks to @tapabratadey for both reports and the measurements behind them.
🤖 Generated with Claude Code