Repository navigation
Conversation
…agrees 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.
|
🦞👀 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 changesThis PR preserves live Windows Gateway owners despite conflicting boot observations and rejects Linux worker TIDs as stale process owners. Example: A Windows owner records startTime 123 and boot identity 2026-10-17T00:00:00.0000000Z; a second process observes the same startTime but boot identity 2026-10-17T00:00:01.0000000Z.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR repairs two current-source ownership defects through existing shared owners. The earlier reboot regression is resolved, no new actionable code defect was found, and current-head CI is green. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup and Doctor compete for shared-state custody; namespace and process-identity observations determine whether existing file locks and database leases block admission or permit recovery. flowchart TD
A[Gateway or Doctor] --> B[Shared ownership admission]
B --> C[Namespace classifier]
C --> D[Process identity probes]
D --> E[Preserve live or uncertain owner]
D --> F[Recover confirmed stale owner]
F --> G[Acquire shared state custody]
Technical reviewBest possible solution: Retain the focused shared-classifier and Linux process-leader fixes while preserving conservative identity handling and existing namespace recovery. Do we have a high-confidence way to reproduce the issue? Current-main source establishes both predicate errors, consistent with the Windows incident and belbix's real-thread observations; this review executed no target code and does not establish full Gateway reproduction. Is this the best way to solve the issue? The patch is the smallest coherent repair: qualify local Windows ownership in the shared namespace owner and reject proven nonleader TIDs in the existing Linux probe, preserving prior recovery safeguards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f66343777a05. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +7, Tests +86, Docs +1. Total +94 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 HistoryReviewed October 18, 2026, 7:59 AM ET / 11:59 UTC (Revision 3). |
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]>
|
@clawsweeper re-review Updated head: 41b1e25. The P1 non-Windows reboot regression is fixed at the shared namespace owner, and the Linux worker-TID repair from #175109 is included with credit. Both regressions use injected process identity probes. Changed-file lint/format and Codex autoreview passed. PR CI is the proof per maintainer policy; live Gateway/lease proof was intentionally skipped. Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/39010322319. The body uses Related for #174895 and records the remaining incident-input ambiguity. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The current head is |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…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: #174895
Fixes #175100
What Problem This Solves
A second OpenClaw process can steal a live Windows Gateway's state lock when boot observations disagree, while a Linux PID recycled as an unrelated worker thread can prevent stale-lock recovery.
User Impact
Live local owners keep exclusive state ownership; dead owners, changed process identities, and Linux worker-TID replacements can be reclaimed. Uncertain process identity preserves the lock and reports how to stop the holder before retrying. No configuration or persisted lock-format change is needed.
The Windows incident did not capture its exact namespace inputs. This fixes the source-confirmed same-host Windows boot-disagreement path; #174895 stays related until the remaining incident ambiguity is resolved.
Why This Change Was Made
Same-host Windows owners now use the existing PID and absolute process-start identity checks in the shared namespace policy. Boot-probe disagreement or an old heartbeat cannot independently revoke that owner. Non-Windows previous-boot recovery and foreign-namespace heartbeat custody keep their existing behavior. Linux's shared process-owner probe also rejects a numeric ID whose procfs Tgid identifies a different leader, preserving permission uncertainty, terminal leaders with live workers, and zero-thread revalidation.
Maintainer cleanup removes the contributor's duplicate boot-comparison helper/export and broad state-owner exception, which ClawSweeper correctly found broke Linux previous-boot Doctor recovery. No detached/background effect or captured authority was introduced; identity is inspected synchronously at the existing checked lock-reclamation boundary.
Original fix by @xiaopan-xydt; maintainer cleanup consolidates the ownership rule and folds in @belbix's worker-TID fix from #175109 with co-author credit. After this PR merges, the coordinator should comment on that draft with the merged PR link and leave it open.
Evidence
PR CI is the test and typecheck gate per maintainer policy. Live Gateway proof, leases, local tests/typechecks, and production-revert negative controls were intentionally skipped under that policy; there are no lease IDs or live-proof claims.
99fccf43358c,06da0de86c0a; Linux conservative probe history:b57aca41466b.uses process identity for a $state Windows owner despite boot disagreementcovers live, unreadable, reused, and exited identities through real lock admission, including an expired heartbeat. Probes are injected; no real process spawning or timer waits are added.rejects a reused worker TID but protects its live process leadercovers both public Linux liveness helpers with injected procfs/signal observations. Existing Doctor previous-boot and namespace recovery regressions remain.41b1e25d075569b3e0dbdd7c94e8e0180487bbc9: 59 jobs passed, 29 skipped. All selected Node/UI tests, production types, lint, and guards passed. Local test wall times were not measured.src/config/io.health-state-scope.test.ts:71,78:ConfigHealthStateStoreno longer implementsDisposable, but two declarations still useusing. These untouched lines came from main commit8d8944985883(refactor(config): simplify captured reads and cached admission #175077). The dedicated repair is test(config): drop stale using declarations after health-state store refactor #175252; this PR does not duplicate that work. The aggregate CI gate fails solely on this typecheck.ClawSweeper revision 2 reviewed this exact head with zero code findings and confirmed that the prior P1 reboot regression is resolved. Its remaining shipped-runtime, negative-control, and existing-data compatibility proof requests are intentionally skipped under the maintainer policy above: PR CI is the proof. The patch changes no persisted lock field, format, database schema, or migration contract.
Diff against merged main: production +13/-6 (net +7), tests +86/-0, docs +1/-0. The small production increase is the two missing platform identity rules; the duplicate proposal helper and staleness branch are gone. No unrelated deletion or weakened check was used to meet a LOC target.