Repository navigation
fix(doctor): reclaim runtimes despite unrelated unreadable cwd - #178278
Merged
Merged
Conversation
Ignore unrelated non-runtime commands without artifact references when their working directory is unavailable. Preserve OpenClaw identities, runtime-path holders, unresolved runtimes, and update-repair ancestry checks. Add a Doctor cleanup regression and update its documented custody policy. Fixes #178189.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
steipete
marked this pull request as ready for review
October 20, 2026 08:37
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 21, 2026
… unreadable cwd (openclaw#178278) Fixes openclaw#178189. Non-runtime commands (not node/bun/tsx) with no OpenClaw identity and no artifact references are no longer treated as runtime holders just because their cwd is unreadable (non-dumpable daemons such as gpg-agent, fusermount3). Node/Bun runtimes with unreadable cwd, OpenClaw identities and artifact-referencing processes still block cleanup.
This was referenced Nov 2, 2026
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.
What Problem This Solves
Fixes #178189. Doctor can retain every abandoned updater runtime when an unrelated process such as
gpg-agentorfusermount3has an unreadable working directory.User Impact
openclaw doctor --fixcan reclaim abandoned runtimes without requiring users to stop unrelated helper processes. OpenClaw identities and observed runtime-path holders still preserve artifacts, including non-runtime executables whose working directory is a retained runtime.Why This Change Was Made
The artifact-custody classifier already recognizes unrelated non-runtime commands, but its missing-cwd branch only exempted foreign users and specific systemd helpers. Apply that existing classification regardless of process ownership when there is no artifact reference, and remove the now-unused parent-command argument. Unresolved Node/Bun processes remain conservative; update-repair handoff ancestry and process-enumeration requirements are unchanged.
Production: +4 / −12 lines (net −8). Tests: +49 / −21 (net +28). The regression runs Doctor's real cleanup contribution and census against synthetic OS observations and real temporary projections. Thanks @davidcittadini for the report.
Evidence
8b680f322829: the new Doctor regression fails because the abandoned runtime remains. It passes with the fix and preserves the runtime used as another process's cwd (287 ms failing / 124 ms passing test time).infra/othertest-type graphs passed (4.7 s / 3.7 s / 2.9 s). Scoped lint, formatting,git diff --check, and Madge passed (zero cycles).scoped-clean, with no accepted/actionable findings. Fresh main36b28bb0f51dhas no intervening changes to the cleanup owner.ProcSafeError: incomplete: unterminated Darwin environment; the native Linux testbox queued and was stopped without running the proof. The regression supplies Linux process-table/cwd observations at the OS boundary rather than mocking the custody decision. No operator state or Gateway was changed.check:changedSQLite inventory was omitted under the campaign's local gate budget; PR CI supplies broad proof.Validation commands
All runtime/test commands used isolated
HOME,OPENCLAW_STATE_DIR, and temporary directories.