Repository navigation
fix(update): reclaim runtimes despite unrelated processes with unreadable cwd - #195162
Open
roboclaw-bot wants to merge 1 commit into
Open
roboclaw-bot wants to merge 1 commit into
roboclaw-bot wants to merge 1 commit into
Conversation
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. |
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
roboclaw-bot
force-pushed
the
roboclaw/ov-195159-unreadable-cwd
branch
from
November 8, 2026 12:28
fe40cd1 to
754f071
Compare
roboclaw-bot
force-pushed
the
roboclaw/ov-195159-unreadable-cwd
branch
from
November 8, 2026 18:20
754f071 to
87f72c3
Compare
This branch has not been deployed
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.
Related: #195159. That report's PID 1007 turned out to be a same-account
systemd --user --deserialize=29manager, which main already recognizes via #178117. This PR covers the different-account case the same census rule also blocked.What Problem This Solves
Fixes updater runtimes accumulating forever when a different, non-root user's Node process has an unreadable working directory.
User Impact
Later updates and
openclaw doctor --fixcan reclaim abandoned private runtimes while that unrelated process keeps running. Root, same-account, unknown-owner processes, and explicit runtime references remain conservative. The updater performing cleanup must contain the fix; it also handles runtimes left by older versions.Why This Change Was Made
The census verifies that the particular runtime is a real directory owned by the inspecting account with no group or other permissions before excluding foreign processes without artifact evidence. Runtime creation already uses private
mkdtempdirectories. Linux credential inspection preserves root in any of the four UID slots, alongside the existing matching-account rule.Process start time is insufficient: an older process can later change directory or load files. This permission rule follows the existing worker model, which never changes user credentials. Manually handing an open private runtime to another account is outside that model.
PID 1007's owner in the original report is still unknown. The issue's ClawSweeper review correctly calls out that gap; this PR supplies a live reproduction for the different-account Node case and preserves root/same-account uncertainty.
Evidence
node worker.js,node -e 1) retain the runtime; two cleanup attempts reclaim neither of two abandoned runtimes. These three regressions pass with the fix. Existing same-account and root retention cases are unchanged.tbx_01m6x9jcq0r76vhv2aytsacez7(run): inspector uid 1001, foreign Node uid 65534, cwd read returns EACCES. On two successive attempts main counts the foreign process as a holder; the fix removes each 0700 runtime while that same process remains alive.git diff --checkpass. Autoreview of the full local candidate against3a25991e37c4bad581b34ebf19f0b9b3e036b5cf, through P3 with complete owner/test context, is scoped-clean. Local ClawSweeper was unavailable; hosted review is pending.The secondary pacman ENOENT spam is already fixed by #186839. The activation listener warning was not reproduced; main already has shared listener cleanup from #191842, whose focused suite passes. A stack trace from a current activation is needed for that follow-up.
CI at this head is red due to download setup failures: OpenGrep, CodeQL, and pinned Bun downloads returned HTTP 504 before scanning/testing. Individual logs confirm setup failures, and
pnpm test:ci-failed 195162selects no Vitest failures to rerun. No code change or workflow rerun was made for the outage. Production/test types, docs, baseline ratchets, source contracts, additional boundaries, and process-boundary Critical Quality passed. Four lint jobs are still running; hosted ClawSweeper has acknowledged the PR but has not reviewed it yet.Simplification: one census owner, no new cache or lifecycle owner, no format/schema change. Production +31/-7 lines; test growth +91 lines covers cleanup and permission/credential boundaries, recorded in
config/test-lines-allocations/update-unreadable-foreign-cwd.txt.