Repository navigation
fix(update): release repair leases before recovery maintenance - #157733
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: blocked before merge. Reviewed September 24, 2026, 9:29 PM ET / September 25, 2026, 01:29 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch makes automatic update triage pass Doctor or update-repair requests to the update owner after the embedded agent and its credential writes settle, with accompanying documentation and tests. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. Current main and v2026.9.6 still lack this fix. The prior deadline concern is resolved, the requested published-updater proof is now documented, and this review found no concrete introduced blocker. Priority: P0 Review scores
Verification
How this fits togetherAfter an update failure, an authorized triage continuation runs an embedded repair agent against the installation. Its maintenance request returns to the update owner, which releases agent-held database and process resources before launching Doctor or update repair. flowchart LR
A[Failed update] --> B[Authorized triage continuation]
B --> C[Embedded repair agent]
C --> D[Maintenance request]
D --> E[Database and process cleanup]
E --> F[Doctor or update repair]
F --> G[Credential and Gateway outcome]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +250, Tests +896, Docs +7. Total +1153 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep maintenance under the update owner, retain refusal for independent database leases and revoked requesters, preserve intentional Gateway stops, and report command completion separately from symptom verification. Do we have a high-confidence way to reproduce the issue? Yes. The current-main path can run maintenance from an embedded repair turn that still owns credential database resources, matching the linked failure trace. This read-only review did not execute the regression. Is this the best way to solve the issue? Yes. The terminal request lets the existing update owner run maintenance after resource cleanup without adding a config or stored-data contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ef2dd3235123. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
|
Merged via squash.
|
…law#157733) * fix(update): release repair leases before recovery maintenance * fix(update): keep maintenance tool name module-private * fix(update): end agent deadline before maintenance handoff
Backport #157696: 09e30a1 Backport #157733: 136ce55 Selected backport #157730: 942a27d Required test prerequisite #156037: 1f55d63 Keep heartbeat progress distinct from authority, settle repair-owned resources before maintenance, and validate complete source content before reusing decoded Doctor rows. Preserve the frozen runtime-entrypoint owner and its standalone child protocol. Schema remains v18. Source-bound targeted/native/built-child proof and independent review pass. This is not a published-package or native service-recovery qualification. Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
Closes #157234
What Problem This Solves
Fixes automatic update recovery blocking its own Doctor step because the embedded repair agent still holds its credential database open.
User Impact
Recovery maintenance can run after the repair turn and its pending writes finish. Other live database users still block maintenance, and a deliberately stopped Gateway stays stopped.
Why This Change Was Made
The embedded repair agent now requests a typed terminal handoff instead of running maintenance within its own turn. The update owner runs the fixed Doctor/update-repair command only after database work and child processes settle. Cleanup failures remain failures, including both causes when process and database cleanup fail together.
No schema or public database-resource API changes. A successful maintenance command is not presented as proof that the original symptom is repaired.
Evidence
UpdateRequesterRevokedError, child exits 1, no credential persisted, and the maintenance PID is extinct. Both processes assert physically private handoff paths before use; all fixture processes settle before removal. The fixture uses a tiny CLI dispatcher around real Doctor admission/storage, not the complete Doctor CLI; it holds the child before its write until the production watcher observes revocation. This does not claim instantaneous revocation fencing between watcher polls.Promise.withResolverserrors inui/src/pages/chat/components/chat-session-workspace.test.ts, also present on main. The aggregate is not green.eb377acCLI installed9669dceusing the canonical full package (SHA-256b9f9ec7af39252fa4bedb4b987ca5b9e14289b8c1275e7838d4df9e49a4abae1). Exit 0, statusok, 131.004 seconds. Candidate snapshot, Doctor migration/lint, config, plugins, recovery check, startup, package swap, full installed Doctor, service reconciliation, and final lint all passed. The legacy synthetic credential survived in canonical SQLite; final config validation passed. Real port probes confirmed the intentionally stopped Gateway before and after. This ran on task-only native Linux storage with physically verified private handoff paths; no host service or live state was mounted.openclaw triageprocess. The embedded runner requestedrequest_update_maintenance; actual Doctor PID 152 exited 0 and was extinct before the fresh-reader check.Maintenance completed.was reported. A fresh native SQLite reader verified the credential and inherited-profilelastProbeAtpersisted after the tool request and before Doctor started. Only the failure context and loopback inference were synthetic; this is a separate post-upgrade continuation cell, not a claim that the successful updater itself encountered a failure. The first oracle incorrectly assumed per-agent storage/lastUsed; source-confirmed shared storage/lastProbeAtverification passed without rerunning maintenance.9669dce. The prior release-priority hold was verified cleared, and the exact deferred run was rerun once; required CI is still pending. The earlier three built v2026.9.4-protocol/manual-repair cases also passed in 40.03 seconds; those remain separately identified as protocol emulation.Measured focused test cost and scope
Observed test time within the grouped run:
update-repair-agent.handoff.test.tsupdate-repair-agent.self-lease.test.tsupdate-repair-agent.runtime.test.tsupdate-repair-agent.bookkeeping.test.tsupdate-repair-maintenance.test.tstriage.maintenance.test.tstriage-prompt.test.tsEvery touched test file was audited in full. The real-runner case protects tool reachability that the cheaper runner mock cannot establish; the separate causal fixture proves lexical ownership and independent-parent refusal. The table reports test time, not standalone wall time. Hosted CI timing will be added when available.