Repository navigation
Factory: run station subagents in the foreground; check state before stopping - #142
Merged
Merged
Conversation
… before stopping The #80 plan run (actions run 43532812887) ended cleanly after 14 turns with nothing written: no branch, PR, comment or label. The likely cause is a subagent launched in the background: a headless run can end the moment the station ends its turn to wait for it. - .factory/README.md: new convention, subagents run in the foreground. - factory-plan: research subagent in the foreground; step 9 checks state.mjs before stopping. - factory-build: sub-stations one at a time in the foreground; don't end the turn before needs:zoom-test unless factory:stuck. - factory-verify: review subagent in the foreground.
ShuhaoZQGG
marked this pull request as ready for review
November 14, 2026 02:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No issue: this fixes the factory after the #80 plan run failed.
Why
The cloud plan station for #80 (run 43532812887) ended cleanly after 14 turns, 71 s and $1.23, with 0 permission denials, and wrote nothing: no branch, PR, comment or label. "Check the station ran" then failed the job, as it should. The action hides the session output, so the cause isn't in the log. The likely one: the station launched its research subagent in the background and ended its turn to wait, and a one-shot headless run can treat that as the end. The last good plan run (#91, Nov 13) was on Claude Code 2.1.323; this one was on 2.1.325.
What changes
Docs for the stations only, no code:
.factory/README.md: new convention, "Subagents run in the foreground": never end a turn to wait for one.factory-plan: the research subagent runs in the foreground; a new step 9 checksstate.mjsbefore stopping, so a station that skipped a step finishes it instead of ending.factory-build: oracle, implement and verify run one at a time in the foreground; don't end the turn beforeneeds:zoom-testunlessfactory:stuck.factory-verify: the review subagent runs in the foreground.The workflows check out
dev, so the stations pick this up as soon as it merges. No workflow file changes, so nothing needs mirroring to master.Security
None.
Production impact
None. Only the factory's skill instructions change.
Testing
npm test: not run locally (Markdown only, no code). CI runs it on this PR.npm run test:e2e: not run (Markdown only).npm run test:specs: ✓ 8 zoom-client spec(s) valid.Evidence (real Zoom client)
n/a: no Zoom-client spec covers these files.
Not verified
claudelogin had expired. If the rerun fails the same way, the next step is a diagnostic that doesn't put the transcript in public logs.Look here first
.factory/README.md, the new "Subagents run in the foreground" bullet..claude/skills/factory-plan/SKILL.md, step 9.