Repository navigation
fix(update): show progress after the Gateway startup check - #157329
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 25, 2026, 6:14 AM ET / 10:14 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch records post-canary cleanup and previous-Gateway readiness in update status, adds wait budgets and Windows-focused checks, and documents operator diagnostics. Merge readiness⛔ Blocked before merge - 11 items remain Current main still leaves post-canary verification without active progress. This PR addresses that gap, but three previously reported blockers remain on the pinned head: a shorter default readiness allowance, unfinished progress for a direct caller, and cleanup that can continue after its outcome is reported. Priority: P1 Review scores
Verification
How this fits togetherThe CLI updater validates a candidate while the managed Gateway serves, then verifies that Gateway before activation. Update-run records feed both CLI progress and JSON status. flowchart LR
A[Update request] --> B[Candidate canary]
B --> C[Temporary-copy cleanup]
C --> D[Previous Gateway checks]
C --> H[Update status]
D --> H
D --> E{Ready within budget?}
E -->|Yes| F[Proceed to activation]
E -->|No| G[Warning and limited rollback]
Decision needed
Why: The ceiling is an intentional upgrade tradeoff that can remove automatic rollback restart eligibility on slow installations; the PR discussion does not contain an explicit acceptance of that change. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +147, Tests +552, Docs +20, Config 0. Total +719 across 17 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the measured default readiness allowance while reporting its progress, close the step for every caller, and settle started cleanup before advancing; validate the repaired driver on the next update hop after a published-driver upgrade. Do we have a high-confidence way to reproduce the issue? Yes, from source: pinned main awaits previous-Gateway readiness before recording its completion, leaving no active verification fact for status during the wait. The PR body also reports a baseline regression at that boundary; this review did not execute an update. Is this the best way to solve the issue? No, not yet. Recording observations at the readiness owner fits the existing status path, but the default budget, direct-caller completion, and started cleanup need the repairs described above. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbcd4df569eb. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
529e5ca to
eeb0cac
Compare
dcbc4ca to
db4a4a8
Compare
db4a4a8 to
9e577c2
Compare
Record previous-Gateway readiness and disposable-copy cleanup at their owners, with explicit budgets and bounded native observations. Preserve ownership checks and warn when readiness remains unverified. Applies to updates running the repaired driver on the next hop. Refs #153401; thanks @WG-Mojo for the Windows/npm evidence. The separate gateway-lifecycle contention remains tracked by #156917.
d0ca46c to
9180594
Compare
Backport #157329: c926e83 Backport #157752: 5f8e15a Backport #157386: 74b9103 Take only the required OverlayFS materialization subset of #157770: 963089a Preserve the frozen lifecycle and ownership contracts. Keep the recorded watchdog outcome without deleting unjoined runtimes, recognize legacy pnpm projections through a bounded store scan, and inspect service scratch roots. Retain the original proofs plus targeted review regressions. Native platform and installed-upgrade qualification remain separate required release proof. Upstream Windows and filesystem evidence credits WG-Mojo and DonnieFi. Co-authored-by: Vincent Koc <[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]>
…157329) * fix(update): show why post-canary verification is waiting Record previous-Gateway readiness and disposable-copy cleanup at their owners, with explicit budgets and bounded native observations. Preserve ownership checks and warn when readiness remains unverified. Applies to updates running the repaired driver on the next hop. Refs openclaw#153401; thanks @WG-Mojo for the Windows/npm evidence. The separate gateway-lifecycle contention remains tracked by openclaw#156917. * test(update): isolate Windows runtime probe budget coverage * test(update): validate the Windows census fixture command * style(update): avoid shadowing the readiness observation * fix(update): preserve readiness ownership and probe allowances * test(update): use the cleanup deferred default type * fix(update): scope native probe budgets to readiness
Refs #153401
What Problem This Solves
Fixes uninformative
validatingintervals after a successful update canary while the updater verifies the previous managed Gateway.User Impact
Operators can see the active verification or temporary-copy cleanup, its recorded wait reason, start time, and budget in CLI progress and
openclaw update status(including JSON). Verification refreshes recorded observations every 30 seconds within a probe stage. The implicit budget ismin(1 hour, max(5 minutes, canary startup × 10)): the startup watchdog supplies the floor, ×10 leaves slow-disk headroom, and the one-hour cap prevents a slow canary creating a multi-hour implicit wait. Explicit--timeoutremains authoritative. Expiry warns and names the next diagnostic command. An unverified previous Gateway remains ineligible for an automatic rollback restart.This applies to updates running the repaired driver on the next hop. It cannot retrofit the installed 2026.9.5 driver. While that driver's window is active, independent
openclaw gateway status --deep --require-rpcand/readyzprobes can show whether the old Gateway is serving; they do not reveal or override the updater's own checks.Why This Change Was Made
The confirmed silent wait is the call to
observeUpdateGatewayReadinessinsrc/cli/update-cli/update-command-readiness.ts:116; completion was recorded only afterward bysrc/cli/update-cli/update-command-verification.ts:124: the driver allowedmax(5 minutes, measured canary startup × 10)but wroteprevious gateway verificationonly after the await completed. A five-minute canary therefore allowed a fifty-minute wait without an active ledger fact. The readiness owner now records the operation before awaiting and updates it from actual native/listener, health RPC, and HTTP observations. Existing completion and ownership checks remain in place.Previous-Gateway readiness caps each native inspection attempt at five seconds (or the smaller remaining budget). Other native service inspections retain their caller-supplied allowance, including the 60-second runtime-publication check before a source rebuild. Disposable-copy cleanup records custody verification separately from filesystem removal and stops waiting after five minutes with retained-path guidance. Already-started filesystem removal can finish in the background; late custody verification cannot start removal after expiry.
Thanks @WG-Mojo for the Windows/npm timeline and independent probes. The report did not capture an awaited stack, so this change does not claim a Node 26 parsing deadlock. The separate post-recovery gateway-lifecycle contention remains tracked by #156917.
The production diff is +232/−85 (net +147); tests are +589/−36 (net +553). Readiness owns the shared budget and durable observations; maintenance owns the cleanup deadline and custody fence; existing observers and status readers carry those facts. The per-attempt cap is scoped to readiness, while native service inspection preserves its caller’s budget. No new config, environment variables, dependencies, or SQLite schema changes.
Evidence
Mechanical leaf-module rebase:
9e577c2646f3f9543fb93326144f472b167f0d16rebases the greendb4a4a8bd298f234d3317d8b9c341f470003675dcandidate onto0bbad56fa80945db4323771873c9944e67454679, retaining main's #157350, #157273, and #156761 changes. The sole conflict was the import block insrc/infra/update-maintenance.ts:UpdateStepResultcomes from main'supdate-step-result.tsleaf, while the cleanup progress callback keeps itsUpdateRunStepledger type. All touchedUpdateStepResultimports use the leaf. Production, source-test, and docs additions/deletions match the reviewed patch exactly; the Windows inventory retains main plus the same three lane fixtures. No semantic changes were introduced; r2 covers this mechanical rebase.Nine touched/owner suites passed 3×, 201 tests per pass, with walls of 183.54s, 165.66s, and 147.74s on Blacksmith Testbox
tbx_01m3az6qhsygs3dr7j7mhc9hqm(run 36077418351);FOCUSED_3X_OK, command exit 0, lease stopped. The completenode scripts/check-changed.mjs --base origin/mainran on Blacksmith Testboxtbx_01m3az6qhj9q1b4segmx5gsjyr(run 36077418412) and exited 1 solely on four max-lines violations in files byte-identical to pinned main0bbad56fa809:packages/ai/src/transports/openai-responses-prompt-observer.test.ts67fd7e910b89, #148567src/agents/workspace.test.tsa219fa50a0a9, #157447src/agents/auth-profiles/oauth-refresh-fence.test.ts67fd7e910b89, #148567src/commands/auth-choice.apply.plugin-provider.test.ts67fd7e910b89, #148567All production/test typecheck graphs and dead-export scans passed. The existing planner then ran every remaining selected check plus targeted type-aware lint on all 14 changed source files on
tbx_01m3b12g43ae4fpjv9wjmjwp71(run 36079881642);REMAINING_CHECKS_OK, exit 0. Both check leases stopped. No source, assertion, suppression, or baseline was changed to hide these main failures, and the complete check is not claimed green.The proof leases verified the 17 changed-file hashes plus
update-step-result.ts; the changed check also verified the effective merge base. Auto-merge remains off for the lead to re-arm. Only this Evidence section was refreshed.Rebase evidence refresh:
db4a4a8bd298f234d3317d8b9c341f470003675drebases the accepteddcbc4cab5f549c46ef6828cce174a5921299eddccandidate onto5d210cc7fd32c6d397ad2743d20d1da1012c4c16. Both main lifecycle fixes (3e9e4cdde3dband1bbd578b463d) are now included. Conflicts were limited topackage.json's Windows inventory and the comment intest/scripts/ci-windows-test-plan.test.ts: all main and lane test entries are retained, and main's complete<425test from #157262 is preserved. The production, source-test, and docs additions/deletions exactly match the pre-rebase patch; no new production semantics were introduced by resolution. The readiness-only five-second cap remains unchanged for the lead's re-review, and auto-merge remains off.Nine touched/owner suites passed 3×, 201 tests per pass, including
run-node-lifecycle.test.tsin every pass. Walls were 850.890s, 455.399s, and 743.399s on the shared Mac. The unchanged retained-service file spent 653.147s, 276.746s, and 504.713s in tests; its slowest case wascertified-doctor-failureat 51.328s. Its previously documented fresh schema-reader cost remains, with elevated host load observed here. No assertions or test deadlines changed. The completenode scripts/check-changed.mjs --base origin/mainpassed with exit 0 on the Testbox; the remote command took 2,424.641s including preparation, and the lease stopped successfully.The local changed-check attempt was explicitly interrupted under host load (88 on 32 cores); its owned process group was stopped and verified gone. The complete check moved to Blacksmith Testbox
tbx_01m3amcdrwjpgtbc1dt8qjtj2z(run 36060321749). Before checking, all 17 changed-file SHA-256 hashes and the effective merge base were verified against this candidate. Only this Evidence section was refreshed.CI correction at
dcbc4cab5f549c46ef6828cce174a5921299eddc(after the lead's merge commit310a9fdac4fc4496718d4d41dddce21556bf752a):readScheduledTaskRuntimereduced the source-rebuild publication guard's explicit 60-second native inspection budget to five seconds. The native adapter now preserves caller budgets; previous-Gateway readiness still supplies five seconds. The restart inspector also respects a shorter per-attempt allowance when an absolute deadline is supplied. Ownership and publication guards remain intact. The captured CI refusal did not include the native query result, so an actual five-second expiry was not directly logged; the budget regression is reproduced by the Windows fixture. Maind563e1a2086b7c1fb76184e0d254f4d35e3c8115passed all three identical helper cases in Windows job 107778087758.<420to<425, with a one-line comment. The production placement target, five-job limit, exact coverage, and synthetic rounding assertion remain unchanged.310a9fdfailed 3/5 cases with PID-file timeouts; one at maina0905dfe5c17053a3f0ef2aa0cf8f421bce9381cpassed 5/5. Main fixes3e9e4cdde3dbffc34366b17dd3a1714173e30c79(isolate service inspection) and1bbd578b463d743e7172309b8b7fbf5dd4cff680(chore: isolate run-node lifecycle signal test #157478, prepare runtime before readiness) own this repair. This PR does not change that fixture; the lead can incorporate those main commits. This is not claimed to be a rerun-fixed flake.The native-budget and absolute-deadline regressions failed before the correction at their intended assertions. Final touched/owner proof passed 3×, 110 tests across six files per pass, in 34.280s, 40.217s, and 34.605s wall time. Fresh Codex autoreview of the complete correction is scoped-clean through P2. The full local
node scripts/check-changed.mjs --base 6e8d06876fd166064abbec4928fb3bb109ebe999passed with exit 0 in 1,747.279s, including core production types, all 25 test graphs, root tooling types, core/script lint, and every selected guard.The 38 source-only importing files were covered locally. The first sweep found four obsolete five-second expectations in the preflight fixture; restoring its main-version 30-second expectations was included in the final 3× proof, and all four remaining Doctor files passed (107 tests). The unchanged update-CLI monolith and retained-service file spent 762.115s and 209.466s in tests on the shared Mac; the existing monolith owner remains #157018. No test deadlines, retries, skips, or mocks were loosened to obtain these results.
Both runtime-dependent importing suites passed 162 tests on Blacksmith Testbox
tbx_01m3afc3gesg28tj3swsjawgg8, run 36050598034, usingnode scripts/run-vitest.mjs src/cli/update-cli/update-command-service.integration.test.ts src/cli/update-cli/update-command-post-update-repair.test.ts --maxWorkers=1. Changed source hashes matched; command exit 0, 322.288s including preparation. The lease stopped after success. Local runtime preparation was blocked by the nested-checkout declaration-input guard, after isolating its profile/state/port; no guard was bypassed. Native Scheduled Task E2E remains Windows-CI-owned.Earlier publication and rebase evidence follows; the current-head proof and attributions above supersede its global native-probe-cap claim.
Rebase follow-up (2026-09-24): head
eeb0cac5c1a42fa986be3519c9fdf8d1905fc1d1rebases ontoc4333da677cb. Conflicts were limited topackage.json(preserve main's Windows selections and add this lane's three files) andsrc/cli/update-cli/update-command-execution.ts(preserve main's install-root import and the ledger-step import). All source/test/docs additions and deletions match the previously reviewed patch exactly. No semantic conflict resolution; no fresh autoreview was needed under the coordinator's condition. Auto-merge is now off.Local focused proof passed 3×, 344 tests across 10 files per pass, in 959.881s, 451.038s, and 245.772s wall time. First-pass worker preparation was 136.547s. The unchanged retained-service file's summed test times were 558.363s, 321.597s, and 181.864s; its slowest case was 32.908s on pass 1, then 8.048s and 6.471s in the later passes.
The requested local
node scripts/check-changed.mjs --base c4333da677cbexited 1 after 823.178s solely on main's unchangedsrc/agents/failover-error.test.ts:1149max-lines violation (1,032 counted lines; limit 1,000; latest owner change #157218). Its file blob is identical to the rebase base (0f0bca19551be0b08510b84af6202e276b100b96). Core production and all 25 test typecheck graphs passed. Targeted type-aware lint on all 15 changed source files passed; every remaining selected check was then run through the existing planner and passed. The full changed-check command is not claimed green; no baseline, suppression, assertion, or unrelated main file was changed.The baseline replay fails at the intended assertions: no active previous-Gateway ledger fact, no active post-canary cleanup fact. The Windows-shaped replay uses the real tasklist/PowerShell listener parser and an isolated SQLite ledger. It checks the running fact, public JSON, rendered status, cancellation, expiry, and completion. Native Windows was unavailable on the Testbox; both Windows-tagged files and cleanup coverage are explicitly selected by
test:windows:ci:1.All eight focused files passed 3×, 258 tests per pass, for the final production bytes. Pass 1 measured each file separately (148.968s total wall); combined passes 2 and 3 took 64.728s and 64.902s. The 126-file importing-test sweep completed successfully (
TEST_PROOF_OK), with native Windows integration skipped on Linux. The two owner suites also passed 3× for the final owner and fixture bytes (86 tests per pass); combined passes took 150.793s and 150.039s.Changed-file costs from
pnpm test <file> --maxWorkers=1:update-command-readiness.windows.test.tsupdate-candidate-canary.cleanup.test.tsupdate-command-service-maintenance.test.tsrestart-health-probe.test.tsschtasks-runtime-probe.windows.test.tsupdate-command-original-service.test.tsThe broader sweep caught two related regressions, repaired without changing their assertions: captured execution ownership is checked before caller-specific guards, and the per-probe cap is explicit for previous-Gateway verification rather than inferred from any deadline. Retained-service verification keeps its existing allowance.
The retained-service fixture now reuses state snapshot worker imports within each case while preserving fresh admission and reads. Test time was 130.861s in the initial Linux sweep and 234.883s in a later sweep; the final passes measured 120.725s, 122.866s, and 123.202s. A Mac single-file pass measured 194.020s. Remaining cost includes fresh agent-schema readers and explicit per-preflight worker scopes in
src/state/openclaw-database-preflight-agent-scheduler.ts:106and:167. Extending those lifetimes requires separate owner work preserving fresh reads, cancellation, and cleanup. No schema-read mocks, weaker assertions, timeout increases, retries, or skips were added.An initial Windows fixture spoof affected Unix SQLite paths and hid an error behind a held-event wait. Scoping the spoof to the Windows listener adapter and settling held operations on failure/cancellation reduced the first regression from a 120s timeout to 208ms in the measured repaired run. Validation also caught and corrected an optional fixture command-array element, a shadowed callback name, and a redundant default generic argument. The final type-only correction passed the focused type-aware lint wrapper and all 19 cleanup tests.
The existing
update-cli.test.tsmonolith (280.482s in the original proof; 475.942s in the later sweep) remains covered by #157018. The approximately 31–33s canary integration is release-only. The final production package build passed in 21m 42.7s; shared build/compiler preparation is separate from test time.Fresh
autoreview --mode branch --base origin/mainis scoped-clean through P2 for529e5cae686ec5f14aac7edc555b358bf3b6b907. All 18 changed-file hashes were verified on the Testbox and matched again against the final commit.pnpm check:changed --base origin/mainpassed on Blacksmith Testboxtbx_01m39r8wysqm4bxb43rdwk23cx(run); output ended withFINAL_GATE_OK, command exit 0, andrunStatus: succeeded(24m 47.043s including the focused cleanup check). All compiler graphs, type-aware core/script lint, and selected guards passed. The importing sweep completed ontbx_01m39h4my9by6cf2a9z8j6a6qx(run); its later two-hour lease expiry interrupted an earlier gate, so that gate was completed on the fresh lease above. Lease cleanup can leave the linked Actions session marked cancelled; the command results are the proof.Auto-merge is now off per coordinator instruction.