Repository navigation
fix(update): repair young runs after recorded drivers exit - #143136
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: needs maintainer review before merge. Reviewed September 9, 2026, 10:56 AM ET / 14:56 UTC (Revision 3). ClawSweeper reviewWhat this changesAllows explicit update repair to clear recent abandoned update records immediately when every recorded updater process is provably dead, with regression coverage and recovery documentation. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and v2026.9.3 still enforce the unnecessary wait. No blocking introduced defect was found, and the existing ownership and recovery safeguards remain intact. Priority: P2 Review scores
Verification
How this fits togetherThe update ledger stores progress and outcomes consumed by update status and the Gateway. Explicit repair checks process ownership and Gateway health before recording an abandoned run as terminal. flowchart TD
A[Operator runs update repair] --> B[Read update history]
B --> C{Recorded updaters provably dead}
C -->|No or uncertain| D[Preserve active run]
C -->|Yes| E[Check Gateway and unfinished work]
E --> F[Revalidate ownership in transaction]
F --> G[Retain abandoned outcome and acknowledge recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +53, Docs +4. Total +64 across 5 files. View PR surface stats
Review metricsNone. 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 immediate explicit recovery in the canonical ledger classifier while preserving conservative automatic recovery, terminal history, and post-core convergence checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: explicit repair of a running record younger than 30 minutes is rejected on current main even when its recorded updater has exited. This review did not execute the reproduction. Is this the best way to solve the issue? Yes. Adjusting the shared abandonment classifier fixes the unnecessary wait without introducing a competing recovery path or bypassing ownership revalidation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4b9ff9dd206b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
4d69221 to
50f6dff
Compare
|
Merged via squash.
|
…er-ownership-20260909 * origin/main: (147 commits) fix(cli): reject blank account selectors before command startup (#143088) fix(update): repair young runs after recorded drivers exit (#143136) test(telegram): close model callback fixture connections (#143197) improve(test): reduce Telegram policy fixture startup overhead (#143192) test(ci): stabilize systemd manager shim timing (#143134) fix(test): retire chat preview Escape listeners during teardown (#143191) test(memory-wiki): share visibility test callbacks (#143181) fix(ci): accept native iOS keychain filenames (#142968) fix(ci): show publication observations in FRV status (#143171) fix(github): point the stuck-FAQ auto-response at a live anchor (#143194) docs: correct verified accuracy defects in CLI, tools, and automation pages (#143179) refactor(tests): remove duplicate Mistral cache-cost test (#143172) fix(doctor): complete canonical model-reference migration (#142284) fix(ci): reject stale and empty timing sample cohorts (#143182) fix(ui): remove first-reply confetti from chat (#143167) docs: split help/faq into 13 topic pages (#143150) refactor(docs): require caller-owned route indexes (#143164) fix(android): distinguish connection status from chat readiness (#143128) refactor: share agent-turn execution test defaults (#143166) fix(cli): print immutable-config refusals without crash framing (#143140) ...
Fixes #141617
Refs #141562
Additional instructions
This branch is in the upstream repository and is editable by maintainers.
What Problem This Solves
Fixes an issue where users running
openclaw update repairwould be told an update was still in progress for 30 minutes after its recorded updater had exited, even when the Gateway was healthy on the installed version and build. The abandonedrequested/runningrow kept the update-in-progress state visible across reconnects.Why This Change Was Made
Explicit reconciliation now checks recorded process ownership without requiring inactivity when every recorded driver is provably dead and no adopter is marked
driver:identity-unavailable. Missing PIDs and changed process-start identities use the existing liveness checks. The ledger rechecks ownership in its terminal write transaction, preserves the original history asfailed/abandoned, and the existing repair path acknowledges the outcome without entering Doctor, maintenance, or failure triage.Identityless rows and rows marked
driver:identity-unavailableretain the inactivity requirement. Live or uninspectable recorded drivers still block repair. Automatic reconciliation, post-core convergence, schema, and retention behavior are unchanged. Documentation explains the explicit-repair rule.User Impact
Operators can immediately clear a young abandoned update with
openclaw update repairwhen its recorded drivers are dead and the installed Gateway generation is healthy. No service stop, database deletion, or coding-agent launch is needed for ledger-only recovery. Reconnects read the terminal outcome; they cannot recreate the old running row.Evidence
Added public-command coverage using real SQLite state and real local process inspection, with controlled Gateway health responses. It covers an exited child PID, a reused PID identity, and a young live driver. Extended existing ledger coverage for young retained parents, an unrecorded adopter, and adoption between inspection and reconciliation.
Before changing production code:
Both failures were the new young/dead-driver regressions. The young live-driver refusal already passed.
After the repair:
The command regression verifies the original row becomes terminal and acknowledged, no replacement row is created, no full finalizer is invoked, and the user sees the no-maintenance success message. Existing watcher tests verify terminal broadcasts and polling cessation; ledger tests preserve first-terminal-wins and reject later adoption.
Additional checks passed before a documentation-only rebase:
node scripts/check-changed.mjs(format, core/test types, lint, ratchets, and architecture guards),pnpm docs:check-mdx(1,196 files), andgit diff --check. The first changed-file run found one formatting issue, corrected with the repository formatter before the successful rerun.Main moved the database reference into topic pages while CI ran. The explanation now lives in
docs/reference/database-schemas/layout.md; production and test files are byte-identical across the rebase. Final-head verification rerannode scripts/run-vitest.mjs src/cli/update-cli/update-repair-command.test.ts src/infra/update-run-abandonment.test.ts(84 passed), checked formatting on the relocated page, and passedpnpm docs:check-mdx(1,215 files) andgit diff HEAD^ HEAD --check.The final-head changed-file gate also passed:
Exact-head CI is blocked by checks-node-changed-extensions-bundle-10, with the required CI gate failing as a consequence. The failed test is the unchanged
extensions/codex/src/app-server/settled-turn-finalizer.native.test.tscaseruns and cancels ephemeral side forks without changing the parent:Its stack runs through the Codex attempt deadline handler; this native side-fork path does not exercise update repair. The affected test and deadline/client files are unchanged from this branch's original base. The underlying native-test failure still needs separate diagnosis; no timeout, assertion, or CI retry was changed to conceal it. All PR checks have settled.
Validation limitations: Gateway probes are controlled boundary tests, not a live macOS/Homebrew or Raspberry Pi upgrade. Driver metadata has no separate boot ID or executable identity; a coincident PID/start identity after reboot remains conservatively protected. A terminal abandoned outcome may remain as a dismissible history card, but it is no longer an update-in-progress card.