Skip to content

fix: update repair clears abandoned handoff leases - #160488

Merged
steipete merged 5 commits into
mainfrom
upd/upd-handoff-lease-dead-owner
Oct 1, 2026
Merged

steipete merged 5 commits into
mainfrom
upd/upd-handoff-lease-dead-owner

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #159897
Refs #159909

Thanks to @taihartman for the Windows report. The process-census capability (#160292) is on main; this PR owns handoff recovery.

What Problem This Solves

Fixes later updates remaining blocked when automatic triage leaves an uncertain handoff after its updater and helper exit.

User Impact

Explicit openclaw update repair can settle the abandoned handoff and admit the next update. It requires both recorded PID/start identities to be provably dead, a readable original run in the selected state database, a complete census without matching or unverified processes, and at least 45 minutes since recorded lease activity, raised by any larger recorded timeout. Refusals explain the next step and identify live or unverified processes when applicable.

Use the failed update's original profile and state overrides. An artifact's run ID alone cannot bypass rollback checks by selecting a different state database. Incomplete rollback retains its generation and artifacts; completed rollback can finalize the restored installation, including headless installs. Gateway startup and borrowed updater processes do not reclaim these leases.

Why This Change Was Made

The existing handoff owner correlates retained artifacts and timeouts, checks process evidence, and claims the exact generation transactionally. Failed repair retains generation-bound evidence across reboot. Successful finalization records and verifies settlement before closing and releasing ownership. Capture/native recovery stays with its existing owner; skipped steps and optional Git-branch cleanup do not strand completed rollback.

The additive schema adds bare nullable recovery_json TEXT, declared canonically and ensured once on first use. Store version and original payload bytes stay unchanged. Downgrade tests execute old named-column SELECT/INSERT/UPDATE operations against the additive schema. Metadata version 3 is distinct from native-custody payload version 3.

The architecture correction puts the borrowed legacy-parent type in the existing leaf contract and gives reclamation only the lease operations it consumes. This removes both Madge cycles without a runtime shim, extra module, or duplicated state owner. The subsequent P1 finding about missing original history was fixed in the same fact reader before any claim.

Production is +474 net LOC, within the approved +475 cap; lease.ts is 692 lines. Production: +552/−78. Tests/support: +1,324/−47; docs: +38. No new configuration/CLI options, dependencies, suppressions, or baseline edits.

Evidence

Fresh direct-route Codex P1 verdict: scoped-clean — no accepted/actionable findings, both review passes, exit 0.

Accepted pre-rebase head: c40c7c8d0557c12f3749cb42ea258f4a771655eb, rebased onto 098173f9f5d47c211541f5bd9595414ed1aeb15d (includes ba80dfbee5a4). Blacksmith Testbox tbx_01m3tpg7189d9gfw56cxy0mf9e (run) fetched that exact SHA and installed with pnpm install --frozen-lockfile; no local tree sync was used.

Final command output:

Import cycle check: 0 runtime value cycle(s).
Madge import cycle check: 0 cycle(s).
B_R6_RESULTS negative=1 cycles=0 architecture=0 types=0 owners=0 siblings=0

pnpm check:import-cycles, full pnpm check:architecture, and core typechecking passed. The final two owner suites passed 3×; all seven cleanup importers passed once. Each owner pass had 48/48 tests; importer proof had 179 passed and five existing skips. The negative control failed for the intended reason: before the guard, repair returned a claim from another state directory while the original ledger retained an incomplete rollback. The fixed case preserves the original lease and history. No new process-family launch was added.

On the preceding architecture candidate 6441a7fd8577b4caf4db21fc55cb4cd581b27b11, the pre-fix control reproduced both reported Madge cycles; the structural fix reduced them to zero. Eight owner suites passed 3× (108 passed and one existing skip per pass), and the remaining 58 importers passed. The later state-context correction reran its affected suites and all architecture checks on the final head.

Earlier full node scripts/check-changed.mjs proof passed on a2707bc6b3341bb2de06f6507c9bbaff6bbaf696. That command checked runtime-value cycles, while the CI architecture job additionally checked Madge's type-dependency graph. The current explicit architecture proof closes that gap.

The captured-cwd case in update-cli.target-schema.test.ts previously failed identically 3/3 on pristine main 80e24f2b1e626e352aebf1d4411cc6ffa4b5df5d and B 4928642dfb46374c9a2ed08bb9e08d4053d0cacd. It is a documented inherited failure; the file was not edited here and passed in the final replay.

The approved Windows-plan bound is <427 for the rounded 426-second census/repair shard. It includes the earlier census adjustment plus the approved extra second; estimates and coverage were not lowered. Native Windows proof remains this PR's own Windows CI lane. Published-driver and Node-runtime live suites were not enabled. No product CI dispatches, reruns, or pushes solely for green were used. Auto-merge was not toggled.

Named, waived follow-ups remain the existing fixture costs in update-cli.test.ts (123 s), update-command-original-service.test.ts (144 s), update-command-lease.test.ts (132 s), update-managed-service-handoff-lifecycle.test.ts (246 s), triage-continuation.test.ts (123 s), update-managed-service-handoff-foreground.test.ts (44 s no-op case), package-acceptance-workflow.test.ts (191 s), and ci-changed-node-test-plan.test.ts (194 s). No timeout, retry, or skip changes were used.

Mechanical rebase closeout: current head c18d175bfa188fccea28fb0fda3d1045aa2b8e6c is rebased onto main 508e2069f83698ffc7d7671a89ceef01612ce91a. The exact conflicted-file list was package.json only. Resolution preserves main's metadata and Windows registrations plus all four handoff repair registrations. Range-diff confirms no behavior changes; the accepted P1 review carries forward under the lead's ruling.

Blacksmith Testbox tbx_01m3tt3nev5xv82r8zmj50cv0j (run) fetched the exact pushed SHA, installed with pnpm install --frozen-lockfile, and ran pnpm check:import-cycles plus the 11 selected owner/tooling suites once. No local tree sync was used. All 11 files passed: 227 tests passed, one existing skip, 51.38 seconds across three Vitest shards. This includes the Windows plan tooling test. Output:

Import cycle check: 0 runtime value cycle(s).
B_R7_RESULTS cycles=0 owners=0 clean=0

Production remains +474 net LOC and lease.ts remains 692 lines. Auto-merge was left unchanged. No CI reruns or dispatches were requested.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: XL labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed October 1, 2026, 12:13 AM ET / 04:13 UTC (Revision 14).

ClawSweeper review

What this changes

The PR extends update repair to reclaim abandoned installation handoffs, preserve recovery evidence in SQLite, and record settlement before releasing ownership.

Merge readiness

⛔ Blocked before merge - 9 items remain

This PR remains necessary: current main supplies process-census support but lacks explicit handoff recovery. All three prior findings remain supported by the pinned head.

Likely related people: steipete and fuller-stack-dev are relevant routing candidates (low confidence).

Priority: P0
Reviewed head: c18d175bfa188fccea28fb0fda3d1045aa2b8e6c

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-boundary validation supports the approach, but three lifecycle defects and scoped authority/upgrade proof gaps prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: the production lease store and ledger are exercised with synthetic process identities and mocked census results, without final-release rejection of a late borrower or recovery after refused release. Published-driver × candidate-state proof is explicitly unrun, so stored-data compatibility remains insufficient. Attach redacted terminal output or logs showing these final effects and upgrade recovery; remove private paths, IP addresses, endpoints, and credentials. Updating the PR body should trigger re-review; otherwise a maintainer can request @clawsweeper re-review. 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 real behavior proof before merge: Authority-chain proof required: the production lease store and ledger are exercised with synthetic process identities and mocked census results, without final-release rejection of a late borrower or recovery after refused release. Published-driver × candidate-state proof is explicitly unrun, so stored-data compatibility remains insufficient. Attach redacted terminal output or logs showing these final effects and upgrade recovery; remove private paths, IP addresses, endpoints, and credentials. Updating the PR body should trigger re-review; otherwise a maintainer can request @clawsweeper re-review. 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 9 items Pinned introduction and merge ownership: Reviewed the merge-base-to-head changes. Raw test-merge parents match the pinned base followed by the exact PR head; its reclamation changes contain the same repair implementation.
Current main still needs this recovery path: Fetched main's reclamation module contains original-generation reclamation and legacy admission, but no explicit handoff repair. The merged census prerequisite explicitly leaves lease recovery to this PR: #160292.
Final release does not repeat artifact-custody inspection: The host census runs during preparation. Completion checks current ownership and registered children, then records settlement and calls ordinary close/release; that release checks lease rows and identities rather than retained run/path references.
Findings 3 actionable findings [P1] Recheck borrower custody before releasing the repaired lease
[P1] Keep a refused lease release eligible for explicit repair
[P1] Include dead running triage leases in explicit repair
Security Needs attention Stale custody evidence permits installation release: Recovery authority persists across awaited finalization, but final release does not reject a newly active process holding retained run/path custody. Releasing the lease can admit another updater while that work remains unresolved.

How this fits together

Update handoffs prevent competing processes from changing the same installation. Explicit repair combines recorded update history, process identities, and retained artifacts to recover ownership and allow later updates.

flowchart TD
  A[Explicit update repair] --> B[Recorded handoff and update history]
  B --> C[Owner and artifact custody checks]
  C --> D{Safe to claim?}
  D -->|No| E[Keep evidence and explain refusal]
  D -->|Yes| F[Finalize current installation]
  F --> G[Record settlement and release lease]
  G --> H[Admit next update]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: the production lease store and ledger are exercised with synthetic process identities and mocked census results, without final-release rejection of a late borrower or recovery after refused release. Published-driver × candidate-state proof is explicitly unrun, so stored-data compatibility remains insufficient. Attach redacted terminal output or logs showing these final effects and upgrade recovery; remove private paths, IP addresses, endpoints, and credentials. Updating the PR body should trigger re-review; otherwise a maintainer can request @clawsweeper re-review. 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.
  • Recheck borrower custody before releasing the repaired lease (P1) - A process referencing a retained run or artifact can appear after prepareRepair() finishes its census, while finalization awaits Doctor, plugin work, and recovery reconciliation. complete() only checks the current lease and registered child rows; ordinary release() does not inspect those run/path references. It can therefore delete the installation lease while an unregistered borrower remains active. Revalidate retained custody at final settlement, distinguishing proven settled repair work from unresolved borrowers.
  • Keep a refused lease release eligible for explicit repair (P1) - When settle(next, "closed") succeeds but release(closed) refuses, the row has a new payload and timestamp while next and recovery metadata retain the running generation. Disposal's store.current(next) consequently fails, leaving the row closed with a stale metadata binding. The next explicit repair excludes closed rows despite the error telling the user to retry. Preserve a current, recoverable generation and its metadata until release succeeds.
  • Include dead running triage leases in explicit repair (P1) - A foreground triage helper and executor can terminate abruptly before either writes the uncertain phase. Such an original lease remains running and has no repair metadata. This guard returns null even after both identities are proven dead, so finalization cannot settle it and later updates remain blocked on the same boot. Apply the existing history, grace, census, and transactional safeguards to this abandoned running case as well.
  • Resolve security concern: Stale custody evidence permits installation release - Recovery authority persists across awaited finalization, but final release does not reject a newly active process holding retained run/path custody. Releasing the lease can admit another updater while that work remains unresolved.
  • Resolve merge risk (P2) - Final-effect evidence does not demonstrate that a late matching or unverified borrower prevents release, or that refused release remains recoverable.
  • Resolve merge risk (P1) - Published-driver × candidate-state proof is explicitly unrun; existing installation recovery and upgrade compatibility remain insufficiently verified.
  • Complete next step (P2) - Repair the three handoff lifecycle findings before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P1] Recheck borrower custody before releasing the repaired lease — src/infra/update-managed-service-handoff-reclamation.ts:229-230
  • [P1] Keep a refused lease release eligible for explicit repair — src/infra/update-managed-service-handoff-reclamation.ts:245-249
  • [P1] Include dead running triage leases in explicit repair — src/infra/update-managed-service-handoff-reclamation.ts:168-170
  • [medium] Stale custody evidence permits installation release — src/infra/update-managed-service-handoff-reclamation.ts:245
Agent review details

Security

Needs attention: The new recovery authority lacks a final artifact-custody check; no dependency or unrelated supply-chain change was found.

PR surface

Source +474, Tests +1277, Docs +38, Config 0. Total +1789 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 11 552 78 +474
Tests 11 1324 47 +1277
Docs 1 38 0 +38
Config 1 1 1 0
Generated 0 0 0 0
Other 0 0 0 0
Total 24 1915 126 +1789

Review metrics

Metric Value Why it matters
Production versus test growth production +552/−78; tests/support +1,324/−47 Production growth implements custody discovery, persistent recovery binding, and settlement in the existing owner.
Persistent contract 1 nullable SQLite column added Recovery metadata changes restart and upgrade behavior independently of the unchanged payload version.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/update-managed-service-handoff-cleanup.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #159897
Summary: This PR is the explicit recovery candidate for the stale-handoff report; merged census work supplies a prerequisite rather than the fix.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Complete owner settlement and recovery proof (recommended)
    Repair the three lifecycle defects and provide final-effect custody evidence plus a published-driver recovery case before merge.

Technical review

Best possible solution:

Keep recovery in the existing handoff owner, preserve generation-bound evidence through refused settlement, and verify safe recovery from published-updater state.

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

Yes, source establishes focused triggers: introduce a matching borrower after preparation, refuse release after closing, or repair a dead running triage lease without metadata. These paths were inspected but not executed during this read-only review.

Is this the best way to solve the issue?

The existing handoff owner is the right repair boundary, but the proposed settlement lifecycle still loses custody freshness and retryability.

Full review comments:

  • [P1] Recheck borrower custody before releasing the repaired lease — src/infra/update-managed-service-handoff-reclamation.ts:229-230
    A process referencing a retained run or artifact can appear after prepareRepair() finishes its census, while finalization awaits Doctor, plugin work, and recovery reconciliation. complete() only checks the current lease and registered child rows; ordinary release() does not inspect those run/path references. It can therefore delete the installation lease while an unregistered borrower remains active. Revalidate retained custody at final settlement, distinguishing proven settled repair work from unresolved borrowers.
    Confidence: 0.94
  • [P1] Keep a refused lease release eligible for explicit repair — src/infra/update-managed-service-handoff-reclamation.ts:245-249
    When settle(next, "closed") succeeds but release(closed) refuses, the row has a new payload and timestamp while next and recovery metadata retain the running generation. Disposal's store.current(next) consequently fails, leaving the row closed with a stale metadata binding. The next explicit repair excludes closed rows despite the error telling the user to retry. Preserve a current, recoverable generation and its metadata until release succeeds.
    Confidence: 0.99
  • [P1] Include dead running triage leases in explicit repair — src/infra/update-managed-service-handoff-reclamation.ts:168-170
    A foreground triage helper and executor can terminate abruptly before either writes the uncertain phase. Such an original lease remains running and has no repair metadata. This guard returns null even after both identities are proven dead, so finalization cannot settle it and later updates remain blocked on the same boot. Apply the existing history, grace, census, and transactional safeguards to this abandoned running case as well.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b58f2a2c3327.

Labels

Label changes:

No label changes.

Label justifications:

  • P0: The underlying Windows report describes updates remaining blocked after repair, with manual database deletion as the only observed recovery.
  • merge-risk: 🚨 compatibility: Persistent recovery metadata and published-updater state need verified upgrade and interrupted-recovery compatibility.
  • merge-risk: 🚨 security-boundary: The new recovery authority can release installation ownership using artifact-custody observations taken before finalization.
  • merge-risk: 🚨 availability: A refused release can strand a closed lease that explicit repair cannot reclaim.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the production lease store and ledger are exercised with synthetic process identities and mocked census results, without final-release rejection of a late borrower or recovery after refused release. Published-driver × candidate-state proof is explicitly unrun, so stored-data compatibility remains insufficient. Attach redacted terminal output or logs showing these final effects and upgrade recovery; remove private paths, IP addresses, endpoints, and credentials. Updating the PR body should trigger re-review; otherwise a maintainer can request @clawsweeper re-review. 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] Stale custody evidence permits installation release — src/infra/update-managed-service-handoff-reclamation.ts:245
    Recovery authority persists across awaited finalization, but final release does not reject a newly active process holding retained run/path custody. Releasing the lease can admit another updater while that work remains unresolved.
    Confidence: 0.94

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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.

  • Repair final custody validation, refused-release retryability, and dead-running-lease selection.
  • Show allowed settlement and rejection of a late matching or unverified borrower before lease deletion.
  • Verify recovery using state produced by a published updater, including retry after refused settlement.

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-29T23:07:01.495Z sha 0650877 :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Leave a refused release eligible for another repair
  • reviewed 2026-09-30T00:00:29.664Z sha 5e56841 :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused lease release eligible for repair
  • reviewed 2026-09-30T03:06:19.520Z sha 5e56841 :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Leave a refused lease release eligible for repair
  • reviewed 2026-09-30T04:46:09.505Z sha 2976faf :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused release eligible for explicit repair
  • reviewed 2026-09-30T19:13:29.554Z sha a2707bc :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused lease release eligible for explicit repair | [P1] Include dead running triage leases in explicit repair
  • reviewed 2026-10-01T01:47:09.766Z sha 6441a7fd8577b4caf4db21fc55cb4cd581b27b11 :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused lease release eligible for explicit repair | [P1] Include dead running triage leases in explicit repair
  • reviewed 2026-10-01T03:07:05.285Z sha c40c7c8d0557c12f3749cb42ea258f4a771655eb :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused lease release eligible for explicit repair | [P1] Include dead running triage leases in explicit repair
  • reviewed 2026-10-01T04:00:07.572Z sha c40c7c8d0557c12f3749cb42ea258f4a771655eb :: needs real behavior proof before merge. :: [P1] Recheck borrower custody before releasing the repaired lease | [P1] Keep a refused lease release eligible for explicit repair | [P1] Include dead running triage leases in explicit repair

@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch from 1725f91 to ec9c669 Compare September 28, 2026 15:38
@steipete
steipete force-pushed the upd/upd-handoff-process-census branch from f30c47f to 9586e1f Compare September 29, 2026 07:11
@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch from ec9c669 to 1b25aa7 Compare September 29, 2026 07:49
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@steipete
steipete force-pushed the upd/upd-handoff-process-census branch from 9586e1f to 10a8d83 Compare September 29, 2026 10:13
@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch from 1b25aa7 to 5c0339e Compare September 29, 2026 10:15
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 29, 2026
@steipete
steipete force-pushed the upd/upd-handoff-process-census branch from b379b35 to eada642 Compare September 29, 2026 17:25
@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch 3 times, most recently from 0650877 to 5e56841 Compare September 29, 2026 23:53
steipete added a commit that referenced this pull request Sep 30, 2026
Process-census capability needed to distinguish a dead managed-service handoff owner from a surviving descendant: a Windows process census (PID, start identity, command line, cwd, owner SID with the foreign-owner rule from the Unix contract), verified Unix UID provenance for incomplete observations, and retained-artifact reference matching that reports matching versus unverified PIDs. Existing callers keep their classification when the new evidence is absent.

Refs #159897 (the reclaim itself follows in #160488).

Landed under the pre-existing-red rule: the remaining CI failures were current main reds in the merge window (fast-lane config expectation fixed by e0ec544; cron service tests fixed by 5f76cc4; update-candidate-canary from b36eb3e).
Base automatically changed from upd/upd-handoff-process-census to main September 30, 2026 02:59
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 30, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Sep 30, 2026
@steipete
steipete marked this pull request as ready for review September 30, 2026 04:40
@steipete
steipete enabled auto-merge (squash) September 30, 2026 05:14
@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch 2 times, most recently from a2707bc to 6441a7f Compare October 1, 2026 01:41
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 1, 2026
@steipete
steipete force-pushed the upd/upd-handoff-lease-dead-owner branch from c40c7c8 to c18d175 Compare October 1, 2026 04:03
@steipete
steipete merged commit 9680e57 into main Oct 1, 2026
228 of 230 checks passed
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Landed via the admin exception for an inherited failure (squash 9680e57a9631b6a7060b9d4642bffb9f9fbc3000, head c18d175bfa18; lead reviews r2 at a2707bc6 and r3 at this head, both scoped-clean).

Inherited failure on the PR head: checks-windows-node-test-2 → src/infra/package-update-swap.windows.test.ts ("preserves the package after persistent EPERM on linux (retries=false)"), the main red introduced by #162231 and being fixed forward by its own lane; this PR touches no package-update swap files. All other 174 checks green (one still in progress at merge time). No CI was re-spent.

@steipete
steipete deleted the upd/upd-handoff-lease-dead-owner branch October 1, 2026 04:16
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…evidence (openclaw#160488)

The managed-service handoff lease owner retained an uncertain foreground handoff forever: a dead handoff owner's lease could never be reclaimed and no repair path could establish descendant absence, so updates ended in reconcile:abandoned and operators had to intervene by hand. Reclaim now uses process-census evidence (unverified or unresolved census vetoes), generation-bound metadata on the existing handoff table (nullable additive columns, same store version, lazy idempotent ensure), an atomic ownership claim, failed-repair retention, and a settlement receipt recorded before release; openclaw update repair has an explicit reclaim admission; reboot reclamation preserves generation-bound repair metadata; a state-override path that could bypass the fail-closed admission is closed. Legacy rows without metadata are reclaimed only after a 45-minute floor plus the census.

Closes openclaw#159897
Refs openclaw#159909, openclaw#161090, openclaw#161721, openclaw#161761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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.

[Bug]: Stale managed-update handoff lease from a dead triage run blocks all updates; update repair does not clear it (Windows, 2026.9.5)

1 participant