Skip to content

fix: reclaim updater runtimes blocked by unrelated Linux processes - #200657

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/ur-200637
Nov 17, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/ur-200637

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

On Linux, openclaw doctor --fix can keep abandoned updater runtimes forever because an unrelated Node process belongs to root and its environment cannot be read. In the reported case, a Docker service caused Doctor to retain directories of about 627 MB each, even after that service restarted.

Fixes #200637

User Impact

Doctor can reclaim these abandoned runtimes without elevated privileges. Same-account and unknown-owner uncertainty still preserves runtimes, and positive OpenClaw or runtime-path evidence still prevents deletion, including references from another account.

Why This Change Was Made

The custody owner now uses the UID already observed by the process census to distinguish a foreign account's unreadable service marker from holder evidence. It checks available paths and absolute preload aliases before excluding that process, even when its working directory is hidden. Missing cwd alone keeps its existing conservative behavior.

The Doctor performing cleanup needs this fix; it works with runtimes left by older updaters without changing their markers, config, or stored state.

Verified on main at 235e38488bf2cac52d29ffde71c7e066b69f1649: the Node/Bun/tsx argv check triggers an environment read; EACCES becomes unclassified identity, then the census adds unknown custody to blocking PIDs. The selecting signal was the JavaScript runtime in argv, without requiring cwd or mapped-file evidence. The macOS repair in #185342, related to #185359, narrowed environment inspection for system binaries but deliberately retained JavaScript-runtime uncertainty; Linux already used that narrower inspection rule.

Accepted limit: a foreign-account process with an unreadable identity and no positive evidence is excluded; this does not claim that privileged inspection proved it unrelated. No privileged inspection, live Docker recreation, or stable-release upgrade matrix was run. Broad validation is left to PR CI.

Evidence

  • Before production edits, the two regression files on base 57b9b9bc786796c07ab5b2489244521ca14d739f had 3 failures and 91 passes: actual Doctor cleanup left the abandoned directory behind, and the census blocked foreign-root and foreign-user EACCES fixtures. Errors are injected through the filesystem/process-inspection seams, without mocking custody decisions.
  • With the fix, those same files pass 94/94. All 183 tests in seven named files pass, covering the census, Doctor runtime cleanup, Windows and missing-command siblings, and plugin-capture consumers. No previously passing case fails with the fix.
  • Controls retain same-user uncertainty, unknown ownership, a same-user OpenClaw process, foreign argv/cwd holders, and a foreign preload alias with hidden cwd. Doctor deletes the free runtime while retaining the positively held runtime.
  • CI's core-leaf oxlint command passed on all three touched TypeScript files: timeout 120s pnpm exec oxlint --type-aware --type-check --threads=1 --tsconfig config/tsconfig/oxlint.core.json <files>. Oxfmt and git diff --check passed.
  • Test cost: base census file 4.39 s; base Doctor file 37.01 s, mostly initial worker compilation. Final seven-file run: 52.19 s across three sequential shards. CI seconds are pending.
  • pr-simplify completed: one existing decision owner, no added helper or state store. Necessary net growth: 16 production lines, 72 test lines, and 5 documentation lines.
  • Independent shared autoreview with Codex, P0–P2, reviewed the complete local candidate against base 57b9b9bc786796c07ab5b2489244521ca14d739f: scoped-clean, no findings. Review included the unchanged classifier, Linux process reader, runtime parser, cleanup owner, and Doctor caller; the reviewer did not independently rerun tests or privileged inspection.
  • Pre-publication overlap check found no open PR fixing this root-process case. Related fix(update): reclaim runtimes despite unrelated processes with unreadable cwd #195162 explicitly excludes UID 0 from its relaxation; fix(doctor): classify protected working directories through a scoped provider #166893 supplies same-account cwd evidence and does not inspect foreign credentials.

Reported by @yoyo837

Work sessions

Linked for team reference; these sessions aren’t public.

Use observed foreign UID evidence when service-marker inspection fails, while retaining positive holders and same-account uncertainty.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 17, 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 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets Linux cleanup exclude foreign-account processes with unreadable service-marker environments after checking available OpenClaw and runtime-path evidence.

Example: An unrelated root-owned node /app/server/index.mjs process returns EACCES during environment inspection.

  • Before: Doctor retains abandoned updater runtimes, reported as approximately 627 MB each.
  • After: Doctor can remove abandoned runtimes while preserving candidates with positive holder evidence.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation and reported regressions support correctness, but required real-behavior evidence remains absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Doctor repeatedly retains large abandoned updater directories because an unrelated root-owned Linux service cannot be fully inspected.
Reason: The reported failure is concrete, the repair is narrow, and the maintainer-authored PR records the intended foreign-account tradeoff.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR addresses a current cleanup defect through the existing custody owner, and no definite introduced bug was found.

Priority: P2
Reviewed head: d35a90ca7dd317f88d31f3c90865c0e29377e012

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted Linux openclaw doctor --fix output showing cleanup with an unrelated root-owned process and retention with a genuine holder, plus a latest-stable upgrade run preserving settings and data; omit keys, IPs, and non-public endpoints.
Agent review details

How this fits together

The process census converts OS process observations into artifact-custody decisions consumed by Doctor and updater cleanup.

flowchart TD
  A[Linux process observations] --> B[Process identity classifier]
  B --> C[Artifact custody census]
  C --> D[Doctor and updater cleanup]
  D --> E[Retain held runtimes]
  D --> F[Remove abandoned runtimes]
Loading

Technical review

Best possible solution:

Keep the focused census repair and its positive-holder safeguards in the existing cleanup path.

Do we have a high-confidence way to reproduce the issue?

The official-release report and current source establish the EACCES-to-unknown-to-retention path; this read-only review executed no target code.

Is this the best way to solve the issue?

The smallest complete fix belongs in the existing custody classifier: distinguish foreign-account marker uncertainty while preserving positive holder evidence, same-account uncertainty, and unknown ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 20248a9ec7c3.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +16, Tests +72, Docs +5. Total +93 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 18 2 +16
Tests 2 105 33 +72
Docs 1 6 1 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 129 36 +93

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +18/-2; tests +105/-33 The growth stays within the existing classifier and test suites, covering the reported failure and distinct custody controls without new production machinery.

Labels

Label changes:

  • add P2: Abandoned runtimes consume substantial disk space, but the reported update succeeded and Gateway operation continued.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Abandoned runtimes consume substantial disk space, but the reported update succeeded and Gateway operation continued.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 10:32 AM ET / 15:32 UTC.

@roboclaw-bot
roboclaw-bot merged commit f65e4db into main Nov 17, 2026
136 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/ur-200637 branch November 17, 2026 15:40
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…penclaw#200657)

Use observed foreign UID evidence when service-marker inspection fails, while retaining positive holders and same-account uncertainty.

Co-authored-by: steipete <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…200657)

Use observed foreign UID evidence when service-marker inspection fails, while retaining positive holders and same-account uncertainty.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit f65e4db)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit fa406fe665337351e76f02f0e7a3f74bb655b310)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Docker container root process (unverifiable via EACCES) permanently blocks updater runtime cleanup on Linux

1 participant