Repository navigation
fix(update): keep rolled-back Git installs runnable - #117294
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 5:15 AM ET / 09:15 UTC. ClawSweeper reviewWhat this changesThe PR makes Git-based update rollback rebuild and verify the original checkout before allowing a managed Gateway restart after a failed live build or validation step. Merge readiness⛔ Blocked by patch quality or review findings - 6 items remain Keep this PR open: it fixes the post-build rollback path, but a failed dependency install can still restart a managed Gateway without rebuilding the rolled-back runtime. The prior P1 concern remains visible at the current head because recovery is armed only after Priority: P1 Review scores
Verification
How this fits togetherThe update command stops a managed Gateway before changing a Git installation, then the update runner checks out, installs, builds, and validates the candidate revision. On failure, the result returns to the post-update CLI flow, which either restarts the Gateway or deliberately keeps it stopped. flowchart LR
A[Managed Gateway] --> B[Update command]
B --> C[Git checkout update]
C --> D[Dependency install and build]
D -->|failure| E[Rollback recovery]
E --> F[Restart-safety decision]
F --> G[Gateway restarted or kept stopped]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +235, Tests +166. Total +401 across 6 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Arm rollback runtime recovery before the first mutable dependency-install attempt, then add a regression that simulates an install failure after mutation and proves the Gateway remains stopped unless the original runtime is rebuilt and verified. Do we have a high-confidence way to reproduce the issue? Yes, by source: make the candidate revision's dependency install mutate state and then exit nonzero; the runner takes Is this the best way to solve the issue? No: recovery is implemented at the right owner boundary, but it begins too late. The recovery marker must cover dependency installation as well as build and post-build validation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f216d3cc868e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
f0def08 to
3216f0d
Compare
|
Merged via squash.
|
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
* fix(update): restore runtime after git rollback * chore(update): leave changelog to release automation * test(update): cover rollback restart policy * test(update): satisfy caller fixture types
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
What Problem This Solves
Fixes an issue where a Git-based update could build the new checkout, fail during doctor or post-build validation, roll source back to the original commit, and then restart the managed Gateway with the newer build output still on disk. That mixed source/build installation could crash-loop instead of recovering the previous working Gateway.
Why This Change Was Made
Git rollback now owns runtime recovery as one transaction. Once a live build has started, it restores the original commit, resolves that commit's package manager, reinstalls dependencies, rebuilds the original runtime, and verifies the build commit, both local build stamps, CLI entry, and Control UI assets against the original SHA. The update result records whether service restart is safe; an unverified recovery leaves the managed Gateway stopped with explicit guidance.
This keeps the existing fast path and preflight build-cache optimization unchanged. Recovery work runs only after a failed mutable update whose live build started.
User Impact
Operators get the previous runnable installation back after a post-build Git update failure. If that recovery itself fails, OpenClaw no longer guesses that restart is safe or starts a mixed installation.
Evidence
distmarker.node scripts/run-vitest.mjs src/infra/update-runner.test.ts— 66/66 tests passed after rebasing onto currentmain.