Skip to content

docgen: detect 'cwd deleted' from claude subprocess + halt loop - #3

Merged
decider merged 1 commit into
mainfrom
fix/docgen-cwd-deleted
May 24, 2026
Merged

docgen: detect 'cwd deleted' from claude subprocess + halt loop#3
decider merged 1 commit into
mainfrom
fix/docgen-cwd-deleted

Conversation

@decider

@decider decider commented May 24, 2026

Copy link
Copy Markdown
Owner

Same fix as the two pbx-* mirrors — kills the runaway-zombie bug where the --until-done loop keeps retrying after the worktree gets deleted underneath docgen.

The detection happens at the claude-subprocess stderr level: when claude reports current working directory was deleted, we flag the error as fatal-batch (halt: true + code: 'CWD_DELETED'), analyzeAllParallel propagates the halt, the outer re-walk loop exits early.

Plus a pre-loop process.cwd() check so we don't spawn the doomed claude call when our own cwd is already gone.

44/44 tests pass locally.

Same fix as private + public mirrors — detects 'cwd was deleted' in
claude subprocess stderr, marks fatal; analyzeAllParallel switched to
Promise.allSettled with halt propagation so one slot's fatal error
doesn't discard the others' results AND the outer loop bails instead
of grinding forever; --until-done entry checks process.cwd() first.

44/44 tests pass locally.
@decider
decider merged commit 82b82f6 into main May 24, 2026
1 check passed
@decider
decider deleted the fix/docgen-cwd-deleted branch May 24, 2026 13:33
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.

2 participants