fix(lock): expire stale owners before pid liveness#86892
Conversation
|
Current head is
The initial GitHub Actions failures on this head appear to be runner/platform setup failures rather than code failures. Examples from the failed logs:
I cannot rerun failed workflows from this account because GitHub requires repository admin rights for |
|
🦞👀 Command router queued. I will update this comment with the next step. |
51255e6 to
6e5c406
Compare
|
Rebased this PR onto current Current head: I also included the same tiny lint-only cleanup for two redundant Current local verification:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed May 26, 2026, 10:31 AM ET / 14:31 UTC. Summary PR surface: Source +17, Tests +7, Other +15. Total +39 across 6 files. Reproducibility: yes. Current main source has a deterministic helper path where a payload with both Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge Security Review detailsBest possible solution: Land the small shared helper fix after required CI and maintainer checks so expired locks are reclaimed before PID liveness while non-expired live locks remain protected. Do we have a high-confidence way to reproduce the issue? Yes. Current main source has a deterministic helper path where a payload with both Is this the best way to solve the issue? Yes. The PR fixes the shared stale-lock helper used by both core and plugin-sdk lock callers and keeps the non-expired live-PID protection intact. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 35310dce8c31. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +17, Tests +7, Other +15. Total +39 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Updated the PR body with structured real behavior proof fields required by the proof gate. The after-fix evidence now includes terminal output from a real @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Velvet Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
a8be0a9 to
0797500
Compare
|
Follow-up pushed at This fixes the Current focused verification after the rebase:
The previous Real behavior proof gate is passing on the structured proof now. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
0797500 to
b9102b0
Compare
|
Maintainer fixup pushed for the merge blocker. Behavior addressed: stale plugin lock recovery now requires owner identity proof before removing a PID-owned sidecar. Timestamp expiry alone no longer steals a live owner's lock; future plugin lock payloads include Linux |
9894280 to
a6cc443
Compare
Fixes #86814.
Summary
createdAtbefore trusting PID livenessReal behavior proof
.lockfiles should be reclaimed even when the lock payload contains a PID that is currently alive or has been reused; non-expired live-PID locks should still be preserved.6e5c406d18, Linux, Nodev22.22.0, runtime path using realacquireFileLock()fromsrc/plugin-sdk/file-lock.ts.auth-profiles.json.locksidecar withpid: process.pidand an expiredcreatedAt, then calledacquireFileLock(filePath, { stale: 10, retries: 0 }).createdAt, proving the expired lock was reclaimed even though the recorded PID was the currently running process.Local verification
git diff --check origin/main...HEADOPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=30000 OPENCLAW_VITEST_MAX_WORKERS=1 timeout 240s node scripts/test-projects.mjs src/infra/stale-lock-file.test.ts src/plugin-sdk/file-lock.test.tsnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/tools/image-tool.tspnpm check:changed@clawsweeper re-review