Skip to content

fix(infra): unify Windows process identity reads [AI-assisted] - #124293

Merged
obviyus merged 8 commits into
openclaw:mainfrom
Chinmayrawat15:fix/win32-file-lock-process-identity
Aug 31, 2026
Merged

obviyus merged 8 commits into
openclaw:mainfrom
Chinmayrawat15:fix/win32-file-lock-process-identity

Conversation

@Chinmayrawat15

@Chinmayrawat15 Chinmayrawat15 commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Windows had two process-start identity paths. The shared file-lock path started PowerShell with a one-second timeout and no fallback, while node-worker checks used the stronger Get-CimInstance plus WMIC reader.

Cold PowerShell startup can exceed one second. The shared path then returned no identity, so a scheduled cron run could not acquire its PID-reuse-safe durable fence.

Why This Change Was Made

The shared process-identity owner now uses one dependency-light Windows reader. The duplicate node-worker platform branch and the older copy inside port diagnostics are removed.

The default Windows deadline is 10 seconds. PowerShell may use at most five seconds, and WMIC receives the remaining time. Gateway lock checks that explicitly request one second remain bounded to one second.

A successful self-process identity is cached for the process lifetime, so cron does not spawn PowerShell on every tick. Foreign process identities remain uncached so PID reuse stays observable.

User Impact

Windows cron runs can acquire and complete durable receipts even when cold PowerShell startup is slow. Node-worker checks use the same identity owner. Missing identity still fails closed, and foreign PID reuse remains protected.

Evidence

Production delta: runtime +151/-106, including the reader moved out of port diagnostics; changed-path tooling +8/-0; tests +257/-61; test-runner configuration +1/-1. Runtime growth records the dependency-light canonical owner and self-identity cache while deleting two duplicate platform paths.

Refs #124125

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Aug 15, 2026
@Chinmayrawat15
Chinmayrawat15 force-pushed the fix/win32-file-lock-process-identity branch from d9ac23d to 56b9923 Compare August 15, 2026 21:51
@Chinmayrawat15
Chinmayrawat15 marked this pull request as ready for review August 15, 2026 21:51
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 31, 2026, 2:29 AM ET / 06:29 UTC.

ClawSweeper review

What this changes

This PR centralizes Windows process-start identity probing, bounds its PowerShell-to-WMIC fallback, caches a successful self-process identity, and adds Windows routing and Gateway-cron coverage.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 6 items remain

Keep open: the Windows cron/lock repair is useful, but the newly introduced reader bypasses OpenClaw’s trusted Windows executable resolver and can select a poisoned process environment path for PowerShell or WMIC.

Priority: P1
Reviewed head: d8a39cfaeb05a4be512cb0bc57e5aa12c36335f3

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has a credible repair and prior Windows evidence, but the reviewed head has a concrete executable-resolution regression and lacks readable exact-head proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The changed production owner is the new Windows process-start reader used by the shared PID helper; the supplied real-host trace proves an earlier head, while the reviewed head adds this reader isolation and no readable exact-head after-fix trace is available. Redact private details in any refreshed Windows output. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The changed production owner is the new Windows process-start reader used by the shared PID helper; the supplied real-host trace proves an earlier head, while the reviewed head adds this reader isolation and no readable exact-head after-fix trace is available. Redact private details in any refreshed Windows output. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Introduced executable-path regression: The new reader constructs PowerShell and WMIC paths directly from process environment variables instead of using the established Windows install-root resolver.
Existing trusted-root contract: The shared resolver prefers HKLM-derived system roots over a poisoned SystemRoot environment value and rejects invalid roots before forming system executable paths.
Current-main behavior: Current main still probes Windows file-lock process starts through a one-second PowerShell path, so the bounded shared-reader improvement is not already implemented there.
Findings 1 actionable finding [P1] Reuse the trusted Windows executable resolver
Security Needs attention Environment-selected system executable path: The new reader chooses PowerShell and WMIC from process environment variables rather than the registry-preferred resolver, weakening the existing executable-selection trust boundary.

How this fits together

Cron receipts, gateway locks, and node workers use a process start time to distinguish a live process from a reused PID. The shared identity helper feeds those lifecycle checks, which either admit work safely or fail closed.

flowchart LR
  A[Windows cron or lock request] --> B[Shared process identity helper]
  B --> C[Windows process-start reader]
  C --> D[PowerShell then WMIC fallback]
  D --> E[PID-reuse-safe start identity]
  E --> F[Cron receipt and lock decisions]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The changed production owner is the new Windows process-start reader used by the shared PID helper; the supplied real-host trace proves an earlier head, while the reviewed head adds this reader isolation and no readable exact-head after-fix trace is available. Redact private details in any refreshed Windows output. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Reuse the trusted Windows executable resolver (P1) - Import getWindowsPowerShellExePath and getWindowsWmicExePath instead of deriving paths from process.env. The existing resolver intentionally prefers HKLM roots over a poisoned SystemRoot and validates fallbacks; this new implementation can launch or attempt an untrusted path and then return no identity, breaking the cron/lock paths this PR repairs.
  • Resolve security concern: Environment-selected system executable path - The new reader chooses PowerShell and WMIC from process environment variables rather than the registry-preferred resolver, weakening the existing executable-selection trust boundary.
  • Resolve merge risk (P1) - The new reader can bypass registry-preferred trusted executable resolution and fail closed on a poisoned SystemRoot/WINDIR value, reintroducing unavailable Windows process identity in cron and lock paths.
  • Resolve merge risk (P1) - The supplied real-host evidence is anchored to an earlier head; exact-head Windows evidence for the isolated reader is not available in the readable review material.
  • Complete next step (P2) - A narrow mechanical repair can restore the established trusted Windows process-tool boundary without changing the intended fallback deadline or cache semantics.

Findings

  • [P1] Reuse the trusted Windows executable resolver — src/infra/windows-process-start.ts:10-28
  • [medium] Environment-selected system executable path — src/infra/windows-process-start.ts:10
Agent review details

Security

Needs attention: The introduced system-executable path construction bypasses the repository’s established trusted Windows root resolution.

PR surface

Source +45, Tests +196, Config 0, Other +8. Total +249 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 151 106 +45
Tests 5 257 61 +196
Docs 0 0 0 0
Config 1 1 1 0
Generated 0 0 0 0
Other 1 8 0 +8
Total 12 417 168 +249

Review metrics

Metric Value Why it matters
Production versus test delta runtime +45, CI tooling +8, tests +196 The bug fix adds substantial runtime logic after relocating the existing reader, so consolidating onto the existing executable resolver also removes avoidable production growth.

Stored data model

Persistent data-model change detected: migration/backfill/repair: package.json. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Restore trusted executable resolution (recommended)
    Import the existing Windows PowerShell and WMIC path helpers, add coverage for registry-over-environment selection, and refresh exact-head Windows proof before merge.

Technical review

Best possible solution:

Keep one Windows process-tool path resolver: use the existing registry-aware helpers for both probes, retain the single fallback deadline, and attach an exact-head Windows trace after the repair.

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

Yes, source establishes the affected Windows path: a poisoned SystemRoot/WINDIR makes the introduced reader select a different executable root than the existing resolver’s registry-preferred contract; it was not executed in this read-only review.

Is this the best way to solve the issue?

No. Sharing the stronger reader is the right direction, but duplicating executable-root resolution discards an existing security and availability contract; importing the canonical helpers is the narrower repair.

Full review comments:

  • [P1] Reuse the trusted Windows executable resolver — src/infra/windows-process-start.ts:10-28
    Import getWindowsPowerShellExePath and getWindowsWmicExePath instead of deriving paths from process.env. The existing resolver intentionally prefers HKLM roots over a poisoned SystemRoot and validates fallbacks; this new implementation can launch or attempt an untrusted path and then return no identity, breaking the cron/lock paths this PR repairs.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f6d7fe44070a.

Labels

Label justifications:

  • P1: The introduced executable-resolution regression can make Windows cron, lock, and worker identity reads fail closed on active installations.
  • merge-risk: 🚨 availability: A wrong process-tool path returns no start identity, which blocks cron receipts and affects lifecycle recovery paths.
  • merge-risk: 🚨 security-boundary: The introduced path construction bypasses the registry-preferred resolver that protects Windows system executable selection from poisoned environment values.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The changed production owner is the new Windows process-start reader used by the shared PID helper; the supplied real-host trace proves an earlier head, while the reviewed head adds this reader isolation and no readable exact-head after-fix trace is available. Redact private details in any refreshed Windows output. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Environment-selected system executable path — src/infra/windows-process-start.ts:10
    The new reader chooses PowerShell and WMIC from process environment variables rather than the registry-preferred resolver, weakening the existing executable-selection trust boundary.
    Confidence: 0.94

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/infra/windows-process-start.test.ts src/infra/windows-install-roots.test.ts src/shared/pid-alive.test.ts.
  • [P1] node scripts/run-vitest.mjs src/scripts/ci-changed-scope.windows.test.ts.
  • [P1] Run the exact-head Windows process-identity and Gateway-cron proof lane after the repair.

What I checked:

  • Introduced executable-path regression: The new reader constructs PowerShell and WMIC paths directly from process environment variables instead of using the established Windows install-root resolver. (src/infra/windows-process-start.ts:10, d8a39cfaeb05)
  • Existing trusted-root contract: The shared resolver prefers HKLM-derived system roots over a poisoned SystemRoot environment value and rejects invalid roots before forming system executable paths. (src/infra/windows-install-roots.test.ts:27, d8a39cfaeb05)
  • Current-main behavior: Current main still probes Windows file-lock process starts through a one-second PowerShell path, so the bounded shared-reader improvement is not already implemented there. (src/shared/pid-alive.ts:59, f6d7fe44070a)
  • History routing limitation: Blame attributes the current install-root file to a shallow-boundary commit; its raw parent is unavailable locally, so this is only a low-confidence routing signal, not feature-introduction attribution. (src/infra/windows-install-roots.ts:1, a4f6bdf9a822)
  • Proof coverage gap: The supplied PR-body Windows trace is tied to earlier head e0ac12e, while the reviewed head d8a39cf introduces the isolated reader; omitted discussion prevents confirming an exact-head after-fix trace. (d8a39cfaeb05)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Replace the local Windows root resolver with the existing registry-aware executable helpers and retain the one-deadline behavior.
  • Attach a redacted exact-head Windows run that exercises the shared helper and scheduled Gateway cron receipt; updating the PR body should refresh review automatically, or ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (22 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-18T06:13:17.306Z sha e8144de :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T12:25:11.323Z sha e8144de :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T12:51:46.911Z sha e8144de :: needs changes before merge. :: [P1] Use one deadline for both Windows fallback probes | [P2] Finalize the test-owned cron receipt | [P2] Route the cron receipt owner to the Windows lane
  • reviewed 2026-08-30T23:04:54.568Z sha a4c8c09 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-31T02:15:36.968Z sha a4c8c09 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T03:39:01.504Z sha eaf854a :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-31T04:30:13.511Z sha e0ac12e :: needs real behavior proof before merge. :: [P1] Pass an explicit bounded deadline to the shared Windows probe
  • reviewed 2026-08-31T05:41:16.407Z sha 266b047 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 15, 2026
@Chinmayrawat15

Copy link
Copy Markdown
Contributor Author

Thanks — working the Before merge list. All three items are addressed; the head moved to 72726eb for the third.

1. Add real behavior proof — done, and it post-dates the review.

The review ran at 21:57 UTC against 56b9923; I attached the Windows output to the PR body at ~22:05 UTC, so the 2/6 proof score was computed against a body that genuinely did not have it yet. That run was green, and the current head 72726eb is green too — run 31911965363, job 95078426187, hosted windows-2025, conclusion success:

 RUN  v4.1.10 D:/a/openclaw/openclaw
 ✓  unit-fast  src/shared/pid-alive.file-lock-identity.test.ts (5 tests) 5684ms
     ✓ resolves a start identity for the live process  1070ms
     ✓ stays stable across repeated probes so a live owner never looks recycled  830ms
     ✓ reports no identity for an unallocatable PID so reuse still fails closed  498ms
     ✓ still resolves node-worker identity now that it shares the bounded probe  1670ms
     ✓ lets a cron run acquire its durable fence and persist the owning identity  1612ms

Two things in that same log show the win32 branch actually executed rather than short-circuiting: the file takes 152ms on macOS vs 5684ms here (real Get-CimInstance Win32_Process spawns), and the step log is interleaved with #< CLIXML … Preparing modules for first use. emitted by the spawned powershell.exe. Whole-PR CI on 72726eb: 93 passing, 0 failing.

2. Merge risk — node-worker probe tightened 5s → 1s. Fair, and I'd rather prove it than argue it. 72726eb adds a real-host case to the same Windows-lane file:

const identity = requireNodeWorkerProcessIdentity(process.pid);
expect(identity).toEqual({ pid: process.pid, startTime: getFileLockProcessStartTime(process.pid) });
expect(inspectNodeWorkerProcessIdentity(identity)).toBe("live");
expect(inspectNodeWorkerProcessIdentity({ pid: process.pid, startTime: 1 })).toBe("reused");

That case is green on real Windows above (still resolves node-worker identity…, 1670ms for four probes — each one comfortably inside the 1s per-attempt bound). So the exact-head Windows run now exercises the node-worker consumer directly, not just the shared helper, and still asserts PID-reuse detection. Worth noting the tightening is bounded per attempt and keeps the PowerShell→WMIC fallback, and that a null probe on this path degrades to unknown or an explicit throw — never to a false dead/reused.

3. Stored data model — I believe this one is a false positive, flagging it rather than silently ignoring it.

The report lists migration/backfill/repair: package.json and vector/embedding metadata: scripts/ci-changed-scope.mjs. Neither file changes any persistent shape. The complete diff for both is one test-filename list and two path regexes:

  • package.json: adds src/shared/pid-alive.file-lock-identity.test.ts to the test:windows:ci:1 file list.
  • scripts/ci-changed-scope.mjs: adds pid-alive to WINDOWS_SCOPE_RE and WINDOWS_TEST_SCOPE_RE.

My guess is the detector matched substrings inside the test filenames those strings enumerate — openclaw-state-ownership, openclaw-database-paths, session-accessor.sqlite-archive — which are test file names, not schema surfaces. No SQLite schema version, table, column, migration, or config key is touched anywhere in this PR. Happy to be corrected if the detector meant something else.

One honest note carried over from the PR body: I don't have a physical Windows host, so the "after" side is the repo's own windows-2025 lane rather than a hand-captured desktop terminal, and the "before" side is the reporter's real Windows 11 capture in #124125 rather than a run I produced. If a maintainer wants a live-gateway Windows smoke on top of this, that needs someone with a Windows box or Testbox access.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 15, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@Chinmayrawat15

Copy link
Copy Markdown
Contributor Author

Finding accepted and fixed — and it turned out to be load-bearing in a way neither of us had argued. Three commits since the review: 7903ab8 fixes the finding as prescribed, bc47972 fixes what that exposed, 8453f03 fixes what that exposed.

1. The finding — accepted

I had called the 5s → 1s change on the node-worker path a deliberate tradeoff and documented it. Documenting a regression doesn't stop it being one: worker startup could fail closed on a slow Windows host where it previously succeeded, and nothing in this issue required that. getFileLockProcessStartTime now takes windowsProbeTimeoutMs; node-host passes its original 5s explicitly rather than inheriting a default that could later drift.

2. 1s was wrong for every caller, not just node-worker

The exact-head Windows lane on 7903ab8 failed:

 × resolves a start identity for the live process 1167ms
 ✓ stays stable across repeated probes ... 754ms
 ✓ reports no identity for an unallocatable PID ... 688ms
 ✓ resolves node-worker identity under its own probe budget 1429ms

AssertionError: expected null to be type of 'number'

Only the first probe failed; later ones passed in ~700ms. That is PowerShell module load — the #< CLIXML … Preparing modules for first use. records in the same step log — and Server 2025 has dropped the WMIC fallback that used to absorb the miss. The node-worker case survived at 1429ms because your finding had already given it 5s.

This is a correctness bug, not a tuning nit: a timeout yields null, and prepareCronRunReceiptClaim throws on null. Too tight a bound intermittently recreates the exact cannot acquire a durable fence failure this PR removes — it failed 1 of 3 exact-head Windows runs. So the default is now the reader's own 5s.

3. Paying that budget once instead of per tick

Cron re-reads our own identity every ~2s tick, and our own start time cannot change while the process lives, so bc47972 memoizes it. On the exact-head Windows lane the effect is visible:

1s, no memo (72726eb) 5s + memo (bc47972) Windows-scoped memo (8453f03)
identity suite 5684ms 1588ms 1352ms
cron durable-fence case 1612ms 348ms 319ms

The per-tick spawn is gone, which bounds the hot path better than the short timeout did — a more direct answer to merge-risk: 🚨 availability than the 1s bound was.

4. Then the Linux lane caught my memo

bc47972 broke five gateway-lock ownership tests on Linux — keeps lock on linux when proc access fails unless stale, keeps a verified maintenance owner when process start identity is unavailable, and siblings. Correctly so: those paths depend on a failed procfs read reporting no identity, and a memo answered with a previously cached value instead. Real behavior change, not a test artifact.

8453f03 scopes the memo to Windows, where its justification actually holds — PowerShell costs hundreds of milliseconds; a procfs read or a ps call does not, so caching there would trade an observably-unreadable identity for nothing. Linux and Darwin are byte-identical to main again, Windows keeps the speedup, and there is now a Linux test asserting the live-read contract that broke (successful read, then failing read must return null).

5. Where the diff ended up

Executable production is +13 (+30 / −17); comments a further +33. It was −5 before this round. The growth is the caller budget you asked for plus the Windows memo and its self-PID guard. I can get back under water by dropping the memo, but that is what makes a 5s budget safe on the timer path — without it cron blocks up to the full budget every tick on an unhealthy host, which is the availability objection the short bound was trying to answer. The two deleted duplicate win32 branches still absorb part of the cost; without them this would be roughly +25. If you would rather have the smaller diff and accept per-tick probing on Windows, say so and I'll cut the memo — that is a maintainer call, not mine.

6. Coverage and verification

New/updated tests: node-host pins the forwarded 5s from both entry points (verified it fails when the argument is dropped); pid-alive covers the default budget, a caller bounding harder, the Windows self-PID memo probing exactly once, a foreign PID not being memoized, and Linux re-reading live. No reset hook was added to production for the memo — $test-audit forbids test-only production seams.

Local on 8453f03: the full affected set green across pid-alive{,.file-lock-identity}, node-worker-{process-identity,supervisor,supervisor.recovery,launch-store}, gateway-lock{,.roles,.state-dir}, stale-lock-file, startup-migration-checkpoint, run-receipt-store{,.null-start-time}, run-lease, quarantine-health; run-tsgo -p tsconfig.core.json, run-tsgo-core-test-shards, check-import-cycles (0 cycles), run-oxlint, oxfmt --check clean; autoreview --engine claude --mode uncommitted clean.

Exact-head CI on 8453f03: checks-windows-node-test green (5/5 real-host cases on windows-2025) and checks-node-compact-small-5 green — the Linux shard whose gateway-lock ownership tests the earlier memo had broken. Whole-PR CI on this head: 94 passing, 0 failing.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 31, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 31, 2026
@obviyus obviyus changed the title fix(infra): bound the Windows process-identity probe with one deadline [AI-assisted] fix(infra): unify Windows process identity reads [AI-assisted] Aug 31, 2026
@obviyus

obviyus commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 124293
head: d8a39cf
breaking: 964fa99
check: openclaw/ci-gate

@obviyus

obviyus commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Chinmayrawat15!

Proof: On exact head d8a39cfaeb05a4be512cb0bc57e5aa12c36335f3, a GitHub-hosted Windows runner held cold PowerShell past five seconds, observed the WMIC fallback, launched the worker, passed 12 cold identity checks, and completed a naturally scheduled Gateway cron receipt with status: ok: https://github.com/openclaw/openclaw/actions/runs/33363932920

  • Bug: Windows cron fencing could lose process identity when cold PowerShell exceeded the old one-second path.
  • Fix: One dependency-light Windows identity owner now gives PowerShell five seconds, gives WMIC the rest of one 10-second deadline, caches successful self identity, and keeps foreign PID checks live.
Before After
Slow cold PowerShell could return no durable-fence identity. The shared owner reaches WMIC and records the real process identity.

@Chinmayrawat15

Copy link
Copy Markdown
Contributor Author

Thanks for finishing this off, and for the cold-PowerShell run.

That proof answers the thing I got wrong. I capped the whole probe at the 5s default, so a PowerShell call that used its full budget left WMIC nothing, and the fallback was dead in exactly the case it exists for. Capping PowerShell at 5s inside a 10s deadline is the right shape, and your run shows the old 1s path in pid-alive was the actual bug rather than a safe bound.

Same story on the consumer branches. I left them in because they routed to Get-CimInstance with the WMIC fallback while getFileLockProcessStartTime still used Get-Process, so deleting them looked like a downgrade. Pointing the shared helper at the stronger reader first is the version I should have written. Pulling it all out into windows-process-start.ts is cleaner than what I had, and the e2e test is better evidence than the unit test it replaced.

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

Labels

merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants