Skip to content

Factory: run station subagents in the foreground; check state before stopping - #142

Merged
ShuhaoZQGG merged 1 commit into
devfrom
chore/factory-headless-subagents
Nov 14, 2026
Merged

ShuhaoZQGG merged 1 commit into
devfrom
chore/factory-headless-subagents

Conversation

@ShuhaoZQGG

@ShuhaoZQGG ShuhaoZQGG commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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 checks state.mjs before 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 before needs:zoom-test unless factory: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

Evidence (real Zoom client)

n/a: no Zoom-client spec covers these files.

Not verified

  • The root cause. The session transcript is hidden in the action log, and a local headless repro couldn't run because the local claude login 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.

… 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
ShuhaoZQGG marked this pull request as ready for review November 14, 2026 02:19
@ShuhaoZQGG
ShuhaoZQGG merged commit e9594f6 into dev Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant