fix: use completed state for successful clusters (visible to heroshot)#416
Open
EivMeyer wants to merge 10 commits into
Open
fix: use completed state for successful clusters (visible to heroshot)#416EivMeyer wants to merge 10 commits into
EivMeyer wants to merge 10 commits into
Conversation
Sonnet validators produced false positives on codebase conventions (ESM .js imports flagged as bugs, correct routing targets flagged as inconsistent). Opus has better nuance for convention-aware validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpletion
Worktrees were preserved indefinitely after runs completed, even with
--ship (PR merged). stop() always kept worktrees for resume capability,
but resume makes no sense after a successful PR merge.
Now CLUSTER_COMPLETE passes { completedSuccessfully: true } to stop().
When completedSuccessfully + autoPr + worktree are all true, stop()
removes the worktree (kill behavior) instead of preserving it. Failed
runs and user-initiated stops still preserve worktrees for resume.
Also adds _teardownWorktreeCompose() to free host ports on stop, and
fixes execSync → safe-exec to comply with ESLint rules.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes from flying-jungle-51 postmortem: 1. verify_github_pr hook: When git-pusher structured output has no pr_number/pr_url (agent failed to create PR), throw clear error instead of falling through to `gh pr view` which picks up unrelated open PRs and reports misleading "Agent LIED" error. 2. isolation-manager: Run configurable setup command after worktree creation. Reads `worktree.setup` from .zeroshot/settings.json (e.g., "npm ci") so all agents have dependencies available. Also includes previously uncommitted polling logic for GitHub API eventual consistency (gentle-hydra-56 regression). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Planning requires deeper reasoning about architecture and approach. Level2 (Sonnet) is sufficient for implementation but planners benefit from the stronger model to produce better implementation plans. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Successfully completed --ship clusters now transition to state=completed (visible in zeroshot list) instead of state=killed (removed from memory). This fixes a critical heroshot integration bug where completed clusters vanished from zeroshot list, causing heroshot to exhaust retries and mark shipped items as failed, blocking the entire downstream DAG. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests that wait for clusters reaching terminal state after CLUSTER_COMPLETE
now expect 'completed' instead of 'stopped', matching the orchestrator
change where stop({completedSuccessfully: true}) sets state to 'completed'.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract 5 new modules from the 960-line monolith: - pr-verification.js: GitHub PR verification with retry logic - hook-sandbox.js: Shared VM sandbox builder (deduplicated) - hook-transform.js: Transform script execution - hook-template.js: Template variable substitution - hook-logic.js: Hook logic evaluation Main file becomes slim dispatcher (116 lines) importing from modules. All files pass strict ESLint (300 max lines, complexity 10, depth 3). Key bug fix: PR fetch now retries 6 times (5s apart) for concrete PR numbers, preventing false HALLUCINATED errors caused by GitHub API eventual consistency after merge + branch delete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d branches Three root causes fixed: 1. merge_commit_sha was required in structured output, but after --delete-branch the remote branch is gone and gh pr view hangs trying to fetch it → agent stuck in retry loop. Now optional. 2. Non-merge-queue path used --auto which requires branch protection. On unprotected branches (dev), --auto silently does nothing. Changed to --delete-branch (direct merge + cleanup). 3. Merge queue poll loop had no timeout on gh pr view and no iteration cap → could hang forever. Added timeout 30 per call and bounded to 90 iterations (30 min max). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
--shipclusters now transition tostate=completedinstead ofstate=killedzeroshot listso heroshot can detect successRoot Cause
When a
--shipcluster finished its work (PR merged, issue closed), zeroshot setstate=killedand removed the cluster from memory + disk. This made it invisible tozeroshot list. Heroshot'smarkShippedFromCompletedClusters()checked forstate=completedwhich never existed — dead code. Result: heroshot respawned 3x → FAILED → all dependents blocked.Changes
src/orchestrator.js:stop()usescompletedstate whencompletedSuccessfully=truesrc/orchestrator.js:_saveClusters()persistscompletedclusters (not deleted)src/orchestrator.js:resume()guards against resuming completed clusterstests/unit/worktree-auto-cleanup.test.js: Updated state assertionsTest plan
🤖 Generated with Claude Code