Skip to content

fix(update): reclaim runtimes despite unrelated processes with unreadable cwd - #195162

Open
roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/ov-195159-unreadable-cwd
Open

roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/ov-195159-unreadable-cwd

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #195159. That report's PID 1007 turned out to be a same-account systemd --user --deserialize=29 manager, 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 --fix can 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 mkdtemp directories. 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

  • Main reproduction: both foreign Node forms (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.
  • Census suite: 70 passed; 43.22 s local wall time including cold compilation, 25.78 s on Testbox. Process-owner suite: 35 passed in 1.76 s; its two new root-credential cases also fail with the base reader. Existing pacman and exit-listener suites: 13 and 6 passed in 5.88 s and 1.50 s respectively. Per-file CI test seconds are unavailable for jobs blocked during runtime setup.
  • Live Linux, Node 24.22.1, Blacksmith Testbox 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.
  • Touched-file lint with type checking, formatting, and git diff --check pass. Autoreview of the full local candidate against 3a25991e37c4bad581b34ebf19f0b9b3e036b5cf, through P3 with complete owner/test context, is scoped-clean. Local ClawSweeper was unavailable; hosted review is pending.
  • No full packaged upgrade was run. PR CI supplies broad checks; no broad tests or packaging ran on the production host.

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 195162 selects 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.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Nov 8, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head fe40cd1adf1ca1fccd0a1ae23972b94b4425579c, but the PR head is now 87f72c3d0932f0c132289ed96629070b3fdebe23. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-08T10:43:39.403Z sha fe40cd1 :: needs maintainer review before merge. :: none

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant