Repository navigation
fix(doctor): reclaim captures beside unrelated runtime processes - #160158
Conversation
|
🦞👀 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. |
|
Codex review: needs real behavior proof before merge. Reviewed September 29, 2026, 9:46 AM ET / 13:46 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch changes Doctor’s process census and shared Node/Bun argument parsing so it can reclaim abandoned plugin captures and updater runtimes beside unrelated processes, and adds tests and documentation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 8 items remain Keep this PR open. Current main still has the reported Doctor cleanup gap, but this branch introduces a regression for manifest-free foreign scripts and lacks current-head proof of the cleanup authority boundary. Priority: P2 Review scores
Verification
How this fits togetherDoctor finds abandoned plugin captures and updater runtimes during maintenance. Its process census reads live commands, working directories, and package evidence before cleanup preserves or removes those artifacts. flowchart LR
A[Doctor maintenance] --> B[Abandoned artifacts]
B --> C[Host process census]
C --> D[Command and directory evidence]
D --> E{Holder or unresolved?}
E -->|Yes| F[Keep artifacts and warn]
E -->|No| G[Remove artifacts]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The diff changes the process-custody decision that permits deletion; current-head native proof of the nearest same-user holder refusal is still needed. PR surfaceSource +249, Tests +318, Docs +1. Total +568 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep positive artifact and owner vetoes, restore the prior classification of resolved foreign scripts that have no OpenClaw evidence, and prove both native custody outcomes through Doctor and the shipped updater. Do we have a high-confidence way to reproduce the issue? Yes. A readable standalone Is this the best way to solve the issue? No. The shared census is the right owner, but its package lookup should not veto an otherwise resolved foreign script with no OpenClaw evidence. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 099380708f99. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
1812449 to
8828248
Compare
Keep unreadable process arguments conservative while treating unfamiliar readable launcher syntax as insufficient evidence of custody. Preserve capture and retained-runtime references in argv, option values, and cwd, using one batched macOS cwd probe. Thanks @Marvinthebored for the report and reproduction in #159950.
Keep the cleanup veto for relative or unresolved entrypoints when cwd inspection fails. Reuse the canonical entrypoint path classifier so unfamiliar launcher flags cannot hide explicit OpenClaw paths, while unrelated Bun processes with readable cwd remain clear.
8828248 to
60605b5
Compare
|
Landed as f7462d5 under the pre-existing-red rule. The remaining CI failures on head 6ca0c65 were all current main reds from #161124 (also failing on main's hourly): |
…nclaw#160158) The process census treated unfamiliar-but-readable argv as a failed inspection, so an unrelated `bun run --silent` process vetoed Doctor's legacy plugin-capture and retained-runtime cleanup. The census now returns a closed holder | non-holder | unresolved result: only positive evidence of foreignness permits cleanup, and every unresolved evidence source (unreadable argv/cwd/package identity, batch timeout) keeps the veto. Closes openclaw#159950. Replaces openclaw#159951 (thanks @Marvinthebored for the finding). Landed under the pre-existing-red rule: remaining CI failures are current main reds from openclaw#161124 (server-restart-sentinel, github-shared-publication-events, server.sessions.list-changed, github-publication-personal-pending).
Closes #159950
What Problem This Solves
openclaw doctor --fixleaves abandoned plugin captures and updater runtimes behind when an unrelated Bun or Node process uses unfamiliar launcher syntax.User Impact
Readable foreign process evidence permits cleanup. Positive custody references and unresolved inspection preserve live artifacts and report a warning. Updates remain best effort; no configuration, schema, dependency, or CLI changes are required.
Why This Change Was Made
The census owns one closed result:
holder,non-holder, orunresolved. Missing argv, cwd, script, package, or module evidence cannot authorize Doctor cleanup. Raw cwd/argv references and resolved artifact paths take precedence over foreign-process exclusions and foreign package identity. The existing verified foreign-UID exemption remains in force when there is no positive custody reference.One runtime parser supplies script position and possible custody operands to all callers. Shared package inspection replaces nested custody conversions. Bun tasks take precedence over same-named files; ordinary Bun loader mappings and known Node scalar options retain their meanings. Opaque module references remain conservative.
The semantic rebase preserves main's strict package-identity admission: enabling a task still needs a regular canonical entrypoint and its verified package root. Executable names, retitles, service markers, and cleanup hints cannot provide that authority. Ordinary Gateway discovery and stale-lock recovery retain their existing command-identity contract.
Rebased onto
baf2edda0d31e48fdb644daae9b802df1e9bf65bafter #151674 moved service-command markers intoinspect-markers.ts. The parser caller adaptation moved with its owner;inspect.tshas no duplicate parser call.git range-diffshows this file move is the only change made by the rebase. #160292 was still unmerged immediately before the rebase and is not included.The subsequent P1 review found that built-in Node test reporters were incorrectly treated as unresolved module references. The parser now recognizes the original built-in reporters (
spec,dot,tap), verified against Node v18.15.0 source, while custom and version-dependent names remain conservative. Four census regressions failed before the fix and passed afterward. The existing Node executable-name check was simplified without changing its accepted names; its six existing tests pass.Thanks @Marvinthebored for the report and Bun reproduction in #159951.
Evidence
node scripts/check-changed.mjs, including production types, all 26 test-type graphs, formatting, lint (0 warnings/errors), and static guards. Longest individual test observed: 4.305 s. No flaky or slow test-time violations encountered.scoped-cleanat P1, exit 0. The accepted built-in-reporter finding was fixed and independently re-reviewed.tbx_01m3m5a57egas0g80pn92bhnd9(coral-crab-3c1c), hydration run. The wrapper verified source head60605b5913acca3ec368ca313ec843125c7ee879and treed73e7e4a7a8f1bad4488da88d1eb5137881a09e0; all ten changed-file hashes matched before execution. Command receipt:command=35m37.022s exit=0,runStatus=succeeded. A post-run provider portal-sync warning did not change the recorded successful command result. No required remote proof gap remains.The published
2026.9.6updater cell and native macOS cwd batch proof belong to earlier head000a54be; they are historical integration evidence, not proof of this candidate's changed classification. Current-head proof and any remote validation gap are listed explicitly above; earlier registered Doctor, service-admission and consumer results are not represented as current-head proof. Hosted CI was not used for proof.Per-file production budget
Compared with rebase base
baf2edda0d31e48fdb644daae9b802df1e9bf65b:src/daemon/runtime-binary.tssrc/infra/gateway-process-argv.tssrc/infra/openclaw-process-census.tssrc/daemon/inspect-markers.tssrc/daemon/service-env-merge.tssrc/daemon/service-layout.tssrc/infra/openclaw-process-census.test.tssrc/infra/gateway-process-argv.test.tssrc/flows/doctor-plugin-source-captures.test.tsdocs/cli/doctor/checks.mdRemoved repeated argv walks, operand-index plumbing, nested custody transport and conversion adapters. No new single-caller helper remains outside the closed classifier itself.
Validated head:
60605b5913acca3ec368ca313ec843125c7ee879. Auto-merge is off.