mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 07:05:57 +03:00
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/203
Author: @CoderMageFox
Created: 2/26/2026
Status: ✅ Merged
Merged: 2/27/2026
Merged by: @mikeyobrien
Base:
main← Head:fix/zombie-worktree-loops📝 Commits (9)
9f58987fix: detect and clean up zombie worktree loops (#202)c0d2ee4style: cargo fmtfa5ff4bfix: keep zombie loops discoverable for cleanup26bb147fix: resolve CI breakages in token accounting updates5574715Stabilize web preflight version checks against transient exec errors0a77a9fDrain trailing PTY output after child exit to avoid race flakes882ea78fix(loops): run fallback cleanup when worktree path is missing684493ffix(loops): keep orphan discoverable if stop signal failsc9fcf6ffix(loops): harden orphan cleanup fallback paths📊 Changes
14 files changed (+582 additions, -32 deletions)
View changed files
📝
crates/ralph-adapters/src/acp_executor.rs(+9 -0)📝
crates/ralph-adapters/src/pty_executor.rs(+97 -0)📝
crates/ralph-api/src/loop_domain.rs(+2 -0)📝
crates/ralph-bench/src/main.rs(+1 -0)📝
crates/ralph-cli/src/display.rs(+1 -0)📝
crates/ralph-cli/src/loop_runner.rs(+7 -0)📝
crates/ralph-cli/src/loops.rs(+303 -7)📝
crates/ralph-cli/src/main.rs(+3 -1)📝
crates/ralph-cli/src/web.rs(+36 -16)📝
crates/ralph-cli/tests/integration_clean.rs(+1 -0)📝
crates/ralph-core/src/event_loop/mod.rs(+11 -1)📝
crates/ralph-core/src/loop_registry.rs(+108 -5)📝
crates/ralph-core/src/summary_writer.rs(+1 -0)📝
crates/ralph-core/tests/smoke_runner.rs(+2 -2)📄 Description
Problem
When a parallel loop's worktree directory is removed externally, the loop process keeps running and the registry entry persists as
running. This creates zombie loops that block parallel slots and can't be stopped viaralph loops stop. The only workaround is manualkill+ editingloops.json.Solution
Adds zombie detection at multiple layers so they are automatically cleaned up:
is_alive()now checks worktree directory existence in addition to PID — this is the highest-leverage fix sincewith_lock(),clean_stale(), andlist()all call itis_pid_alive()added for raw PID checks when you need to send signals to orphan processesWorkspaceGonetermination reason so running loops self-exit when their workspace disappearsralph loops listshowsorphanstatus when PID alive but worktree goneralph loops stopfalls back to registry PID + signal when worktree is missingralph loops discardgracefully handles already-removed worktrees (no moreNotFounderrors)Files Changed
crates/ralph-core/src/loop_registry.rsis_alive()worktree check +is_pid_alive()+ 2 new testscrates/ralph-core/src/event_loop/mod.rsWorkspaceGonevariant + workspace check incheck_termination()crates/ralph-core/src/summary_writer.rsstatus_text()match armcrates/ralph-cli/src/loops.rslist,stop,discardfixescrates/ralph-cli/src/display.rsWorkspaceGonedisplay match armcrates/ralph-cli/src/loop_runner.rsWorkspaceGonein history + merge queue match armscrates/ralph-bench/src/main.rsWorkspaceGonein bench format match armTesting
test_zombie_worktree_detected_as_dead,test_no_worktree_entry_unaffectedCloses #202
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.