Repository navigation
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. What this changesReject Linux worker thread IDs as process owners when procfs identifies a different thread-group leader. Example: A stale lock records PID 1103, now a worker TID whose procfs Tgid is 956, without usable start-time evidence.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it narrowly repairs a current-main process-owner classification gap and is paired with the author's unresolved bug report. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared process-liveness helpers translate signal and operating-system identity observations into owner-liveness decisions consumed by state locks, process supervision, updates, and plugins. flowchart TD
A[Gateway startup] --> B[State owner acquisition]
B --> C[Namespace and start identity checks]
C --> D[Shared PID liveness]
D --> E[Linux procfs status]
C --> F[Checked stale lock recovery]
D --> F
Technical reviewBest possible solution: Keep the process-leader check in the shared Linux predicate while preserving existing start-identity recovery and conservative live-owner protection. Do we have a high-confidence way to reproduce the issue? Source establishes the worker-TID classification error, consistent with the reported real-thread reproduction; existing start-time recovery means the complete current-main startup failure is not independently established. Is this the best way to solve the issue? The shared Linux predicate is the appropriate repair boundary, and the patch preserves the established terminal-thread and uncertain-observation policies. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 66ffabc522ac. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +14. Total +20 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 12:58 AM ET / 04:58 UTC. |
Use the shared namespace policy to qualify local Windows PID/start identity instead of letting disputed boot observations revoke a live state owner. Preserve non-Windows previous-boot recovery and remove the duplicate state-owner exception. Reject Linux worker TIDs as process.pid owners while retaining conservative permission, thread-group, and reaping behavior. Add deterministic process-identity regressions and recovery guidance. PR CI owns tests and typechecks; local proof is changed-file lint and formatting. Related: openclaw#174895. Fixes openclaw#175100. Folds in openclaw#175109 without closing it. Co-authored-by: xiaopan-xydt <[email protected]> Co-authored-by: belbix <[email protected]>
…5118) * fix(gateway): prevent spurious restart when Windows boot identity disagrees When same-host Windows boot identity probes disagree, fall back to PID and start-time evidence instead of treating the owner as immediately dead. This preserves a live Gateway lock while retaining recovery for dead or reused PIDs. * fix(gateway): preserve live owners and recover recycled Linux thread IDs Use the shared namespace policy to qualify local Windows PID/start identity instead of letting disputed boot observations revoke a live state owner. Preserve non-Windows previous-boot recovery and remove the duplicate state-owner exception. Reject Linux worker TIDs as process.pid owners while retaining conservative permission, thread-group, and reaping behavior. Add deterministic process-identity regressions and recovery guidance. PR CI owns tests and typechecks; local proof is changed-file lint and formatting. Related: #174895. Fixes #175100. Folds in #175109 without closing it. Co-authored-by: xiaopan-xydt <[email protected]> Co-authored-by: belbix <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: belbix <[email protected]> Co-authored-by: xiaopan-xydt <[email protected]>
|
Your Linux worker-TID fix was folded into #175118, which landed as 1446ecc. Thank you, @belbix — your co-author credit is preserved in the merged commit alongside @xiaopan-xydt. This draft remains open. |
…nclaw#175118) * fix(gateway): prevent spurious restart when Windows boot identity disagrees When same-host Windows boot identity probes disagree, fall back to PID and start-time evidence instead of treating the owner as immediately dead. This preserves a live Gateway lock while retaining recovery for dead or reused PIDs. * fix(gateway): preserve live owners and recover recycled Linux thread IDs Use the shared namespace policy to qualify local Windows PID/start identity instead of letting disputed boot observations revoke a live state owner. Preserve non-Windows previous-boot recovery and remove the duplicate state-owner exception. Reject Linux worker TIDs as process.pid owners while retaining conservative permission, thread-group, and reaping behavior. Add deterministic process-identity regressions and recovery guidance. PR CI owns tests and typechecks; local proof is changed-file lint and formatting. Related: openclaw#174895. Fixes openclaw#175100. Folds in openclaw#175109 without closing it. Co-authored-by: xiaopan-xydt <[email protected]> Co-authored-by: belbix <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: belbix <[email protected]> Co-authored-by: xiaopan-xydt <[email protected]>
…5118) * fix(gateway): prevent spurious restart when Windows boot identity disagrees When same-host Windows boot identity probes disagree, fall back to PID and start-time evidence instead of treating the owner as immediately dead. This preserves a live Gateway lock while retaining recovery for dead or reused PIDs. * fix(gateway): preserve live owners and recover recycled Linux thread IDs Use the shared namespace policy to qualify local Windows PID/start identity instead of letting disputed boot observations revoke a live state owner. Preserve non-Windows previous-boot recovery and remove the duplicate state-owner exception. Reject Linux worker TIDs as process.pid owners while retaining conservative permission, thread-group, and reaping behavior. Add deterministic process-identity regressions and recovery guidance. PR CI owns tests and typechecks; local proof is changed-file lint and formatting. Related: #174895. Fixes #175100. Folds in #175109 without closing it. Co-authored-by: xiaopan-xydt <[email protected]> Co-authored-by: belbix <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: belbix <[email protected]> Co-authored-by: xiaopan-xydt <[email protected]> (cherry picked from commit 1446ecc) Adapted for 2026.9.x: ported only the Linux Tgid check in src/shared/pid-alive.ts and its regression. The Windows boot-identity gateway-lock change, namespace tests, and gateway-lock docs are not included. 9.x names the procfs helper isZombieProcess and only treats a Z leader with one thread as exited, so the Tgid rejection runs before that existing check.
…5118) * fix(gateway): prevent spurious restart when Windows boot identity disagrees When same-host Windows boot identity probes disagree, fall back to PID and start-time evidence instead of treating the owner as immediately dead. This preserves a live Gateway lock while retaining recovery for dead or reused PIDs. * fix(gateway): preserve live owners and recover recycled Linux thread IDs Use the shared namespace policy to qualify local Windows PID/start identity instead of letting disputed boot observations revoke a live state owner. Preserve non-Windows previous-boot recovery and remove the duplicate state-owner exception. Reject Linux worker TIDs as process.pid owners while retaining conservative permission, thread-group, and reaping behavior. Add deterministic process-identity regressions and recovery guidance. PR CI owns tests and typechecks; local proof is changed-file lint and formatting. Related: #174895. Fixes #175100. Folds in #175109 without closing it. Co-authored-by: xiaopan-xydt <[email protected]> Co-authored-by: belbix <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: belbix <[email protected]> Co-authored-by: xiaopan-xydt <[email protected]> (cherry picked from commit 1446ecc) Release adaptation: Apply Linux Tgid validation and same-host Windows namespace handling through the existing release identity owner; preserve PID/start-time and conservative probe behavior. Co-authored-by: RomneyDa <[email protected]>
Related: #175100
What Problem This Solves
Fixes an issue where users restarting Gateway cannot recover a stale state-owner lock when Linux recycles the former owner's PID as an unrelated service's worker TID. The observed incident required quarantining obsolete locks before startup could proceed.
Why This Change Was Made
Locks written with process.pid identify a process leader. Linux kill(pid, 0) also accepts nonleader thread IDs, so the existing existence check can incorrectly preserve a stale owner. Extend the canonical Linux procfs decision with Tgid != pid, retaining current terminal-leader/live-sibling handling and zero-thread snapshot revalidation. Non-Linux native identity policies, schemas and configuration are unchanged.
User Impact
Allows stale state locks whose numeric owner ID now belongs to a worker thread to be reclaimed without a manual lock quarantine. Live process leaders remain protected. No runtime patch has been deployed.
Evidence
Environment and limits
Affected host checked directly: OpenClaw 2026.9.8 (fc23bc8), Ubuntu 24.04.4 LTS x86_64, Linux 4.14.174, Node v24.16.0; global Node package layout and systemd user service (full details in #175100). Exact original failed-process build and original termination cause were not captured independently. This proposal fixes the confirmed worker-TID collision, not all leader-PID reuse across boots.
Prepared with AI assistance from incident diagnostics. Reporter: @belbix. No install, restart, merge, or deployment requested by this PR.