Repository navigation
fix(update): prevent bad pack header failures and recover the stopped gateway - #145501
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. |
|
I’m independently validating this PR for the scoped maintainer landing request. Real Git 2.55 on unchanged main reproduced the reported exit-128 lazy-fetch/promisor failure and I saw your new Independent review found one confirmed P1 in the import boundary. After The fix should retain the imported pack or a private ref through checkout/activation and release only its own retention during cleanup. A regression should run real repack between import and activation, not just assert command flags. This finding remains applicable to 1223e45; Head remains1223e453, with no further source push during the proof window. I am now taking the narrow pack-retention lifetime fix plus real-repack coverage in this PR; I will recheck the live head before any push and preserve all existing commits. No service recovery or process-executor interfaces will be rewritten. Scoped repair status: the real-repack regressions now pass with transaction-owned retention, including checkout publication and preservation of another owner's keep file. A second boundary case was verified with a real Git inventory emitter: handling the output-limit termination signal can still produce exit0. Transfer now rejects killed/non-exit results before packing truncated inventory. The regression uses complete truncated object-ID records, so it cannot pass merely because a cut hash makes Git reject the pack. Sanitized AWS proof at1223 plus the frozen repair:203 focused updater tests passed; after a cleanup-owner extraction and safe errno narrowing for lint, the33 affected admission/transfer tests and all scoped lint checks passed. The three new regression cases also fail on unchanged1223. Fresh independent review of the repaired behavior found no actionable P0–P2 findings; the mechanical lint follow-up is being rechecked. Real task-owned systemd Gateway recovery and actual npm2026.9.4 driver × candidate proof are still running, so this is not a merge-readiness claim. Current main47ce03dbc699 already fixes the unrelated UI dead exports, max-lines and cursor-policy CI failures. I will preserve your ancestry when incorporating that mainline state. No source push yet; all your commits remain intact. Published the tested fixups at e5681fb, preserving every author commit and merging existing mainline CI repairs. The final34 affected tests and scoped lint pass, including the256MiB pre-stop bound. Real systemd valid/invalid recovery passed on the author driver. Final-head native-owner requalification, independent review and CI are running. Actual npm-driver evidence and the first-update limitation are recorded accurately in the updated PR body; no live operator service was touched. CI has one identified unrelated blocker: check-test-types reports undefined A final real-Git retry challenge found another required retention fix before landing: candidate objects left in an unreferenced installed pack by a previous failed attempt are borrowed by the shared inspection clone. Completed the final e568 runtime qualification on isolated AWS, with the observed details here so they do not depend on portal access: Actual SHA512-verified npm2026.9.4 driver × e568 completed in run_b90f9f3319df. Starting from the ordinary detached release Git checkout, it finished candidate validation, stopped the real owned systemd service, then its old Both e568 proofs remain valid for unchanged native recovery/old-driver owners, but do not cover the pending retry-transfer correction. That correction passed actual retry, missing-before blob, older-Git fallback, offline, downgrade and divergent-history cases. The four-file run was202pass/2fail: existing same-candidate cases found a zero-object input bug, now corrected to send zero bytes rather than a blank line. Independent review also found configured pack.packSizeLimit can split output despite --max-pack-size=0; real Git reproduced three packs, fixed by a command-local override preserving the stored config. A2.5MiB configured-limit regression and the corrected205-case set are running, with fresh independent review. No merge-readiness claim yet. CI correction update: standing maintainer scope includes ordinary required-CI fixes. The local branch incorporates minimum existing main584196023ef and replaces the new test's undefined retainedMachine with the immediately preceding machine:fast locator. No assertion or product behavior changes; updater/native-owner bytes from e568 were unchanged by this one-line test repair. Earlier “no UI edit” status is superseded; no CI waiver is used. All author ancestry remains intact. Final corrections published as |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 11:32 PM ET / September 12, 2026, 03:32 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR prepares and retains Git update objects before Gateway downtime, verifies recovery after failed imports, adds regression coverage, and corrects a UI test screenshot locator. Merge readiness✅ Ready for maintainer review This repair remains necessary: current main and v2026.9.4 retain the failing import path. No actionable patch defect remains; the earlier retention finding is resolved, and the maintainer has accepted the published-updater delivery limitation as follow-up work. Priority: P0 Review scores
Verification
How this fits togetherThe Git updater validates a candidate checkout before replacing the installed source and runtime. Its recovery result feeds the service manager, which decides whether the previous Gateway can safely restart. flowchart TD
A[Selected Git revision] --> B[Private candidate validation]
B --> C[Prepare bounded object pack]
C --> D[Admission and service stop]
D --> E[Import retained pack]
E --> F[Activate validated runtime]
E --> G[Verify retained runtime on failure]
G --> H[Owned service recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +264, Tests +397. Total +661 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep candidate preparation before downtime and let the existing service owner restart only a verified retained runtime, with corrected-updater delivery handled through the accepted release follow-up. Do we have a high-confidence way to reproduce the issue? Yes: current source retains the post-stop mirror import and recovery gap, matching the supplied real Git and service failure traces. This review inspected source without executing a reproduction. Is this the best way to solve the issue? Yes: preparing a self-contained transfer and reusing existing runtime and service recovery checks directly repairs the failing boundary without adding a competing recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dda647045420. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Merged via squash.
|
… gateway (openclaw#145501) * fix(update): prevent partial-clone pack failures and recover stopped gateways * fix(update): preserve complete pack inputs during transfer * test(update): narrow optional command arguments in admission coverage * fix(update): omit installed objects from candidate packs * fix(update): retain and bound admitted candidate packs * test(ui): resolve retained machine screenshot target * fix: retain retry objects in candidate transfer --------- Co-authored-by: Jason (Json) <[email protected]>
Closes #145494
Merged as a9ff79407881ec0dd084cdb7d4ac2eeb2719b7e1.
Problem
A partial-clone Git update can finish candidate validation, stop the Gateway, then fail importing from its private mirror with
lazy fetching disabled,could not fetch ... from promisor remote, andbad pack header. The installed source/build remain unchanged, but the old error path skips retained-runtime verification and leaves the service stopped.Change
All contributor commits remain in the branch ancestry. The branch also carried a one-line required-CI test locator repair. Main independently landed the identical change in#145540 before this merge, so the landed commit contains only the five updater/test files. No assertion or UI behavior changes. No dependency, schema, persistent configuration, or live/fleet runtime changes.
Maintainer Verification
Corrected head: 189bf5b.
Actual isolated Gateway recovery
run_fb0b127759ab, source e5681fb: pinned changed-file gate and full build pass. An actual Git pack-directory permission denial causes index-pack exit128 after an observed native systemd stop.
This is real Gateway/manager proof on a disposable task-owned systemd user, not a mocked service or an inference from
serviceRestartSafe. The final staging-only changes are covered by the final real-Git module tests; the source/runtime/service recovery owners are unchanged from this proof. Owned services were stopped afterward. Earlier author-head managed positive-update and valid/invalid recovery evidence remains historical supporting proof, not a claim that every later source revision was rebuilt in those runs.Published-updater first-hop limitation
run_b90f9f3319df: actual SHA512-verified npm2026.9.4 driver, ordinary detached release Git checkout3a9d69db306cd7f081e06254cb89c4bcc14a7107, candidate e5681fb. It completes candidate validation, stops the owned native service, then its original
git fetchimport fails128 with the exact lazy-fetch/promisor/bad-pack errors. Installed SHA stays3a9; ActiveState changes active→inactive. The npm artifact has no Git runtime stamps; none were forged, and this is not presented as valid-retained-runtime recovery.An old installed updater still controls its first attempt. Candidate source cannot retroactively fix that driver. The final transfer correction does not alter the published artifact or this first-hop conclusion. Future delivery/use of a runtime containing the corrected updater is required; this PR does not update the reporter's or any operator's installation. Existing recovery diagnostics remain available when runtime verification fails.
Exact-head CI 34669860146 completed successfully: 114 checks passed and 16 were skipped; required
openclaw/ci-gatepassed.OPENCLAW_TESTBOX=1 scripts/pr prepare-run 145501and nativescripts/pr merge-run 145501both completed successfully. Native completion receipt. All five landed file blobs exactly match the reviewed head.Release-note Impact
Git updates stage partial-clone objects before downtime, retain them through activation, and recover an intact prior Gateway after a failed pre-checkout import. Candidate pack staging is capped at256MiB. Credit: Dallin Romney (@RomneyDa), author and reporter, and Jason (Json) (@fuller-stack-dev), co-driver of transfer retention, retry fixes, and validation.
Author Evidence (through
1223e45324bc)serviceRestartSafe: false.pnpm buildpassed on the author head1223e45324bc. All 27 admission tests also passed with--local.renderCloudConfigurationandrenderConnectMachineMenuIteminui/src/pages/new-session/cloud-target.ts; this file has no diff against basee4129b6375e3. Current main already fixes those UI exports and the unrelated UI line-count/cursor-policy failures; those existing fixes are incorporated without rewriting contributor ancestry.--localproof: five updates with an unchanged 1 MiB file added about 1.3 KiB instead of 5.2 MiB; partial-clone ancestor and divergent checkouts still succeeded offline.Validation commands:
ClawSweeper review
The latest review covers
189bf5b255ee9bd85e41941bbebaa13f64fdcb50and reports no remaining actionable patch defect. The earlier retention finding is resolved: candidate packs remain retained through activation, including retry objects. Availability is addressed by preparing the self-contained pack in private staging before the Gateway stops and verifying the retained runtime on import errors before the existing service-recovery owner decides whether to restart.Maintainer disposition: proceed with this repair. The remaining delivery concern is accepted as a release/operator follow-up, not a claim that candidate code can repair an already-running older updater. Affected installations must obtain and run the corrected updater; the published-driver first-hop limitation and actual failed first-hop proof are recorded above. No additional code fixup is needed for this review, and no re-review request is being posted.