Repository navigation
perf(update): defer Gateway maintenance during candidate validation - #154548
Conversation
Apply the existing candidate flag before session catalogs, worker recovery, and background lifetimes are prepared. Keep configuration, ownership, schema, migration admission, and plugin runtime validation intact. Prove the startup boundary and document manual recovery from the published updater's shared five-minute deadline. The published 2026.9.4 driver upgrades the synthetic ten-agent state successfully, with candidate readiness in 6.134s. Thanks to @ZaneMc-AO and the other timeout reporters. Related: #144858, #154381
|
🦞👀 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 21, 2026, 3:29 AM ET / 07:29 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR makes update-validation Gateways defer serving-only preparation and maintenance, adds readiness and schema-refusal coverage, and documents recovery from the older updater’s deadline. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, bounded improvement absent from current main. No blocking correctness defect was found, and the published-updater proof supports the candidate-startup change without claiming to resolve the reporter’s complete hardware-specific timeout. Priority: P2 Review scores
Verification
How this fits togetherThe updater starts a temporary Gateway against copied state to validate a candidate installation. Gateway startup performs admission checks and loads plugins before returning readiness results to the updater. flowchart TD
A[Installed updater] --> B[Candidate and copied state]
B --> C[Configuration and database admission]
C --> D{Update validation mode}
D -->|Candidate| E[Defer serving maintenance]
D -->|Normal startup| F[Prepare serving services]
E --> G[Load plugins and report readiness]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests +156, Docs +13. Total +180 across 8 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. Technical reviewBest possible solution: Keep candidate validation focused on admission, plugin loading, and readiness while the activated serving Gateway owns maintenance and session preparation. Do we have a high-confidence way to reproduce the issue? Yes for unnecessary candidate startup work: current-main source invokes the deferred owners, and the supplied regression records failure before the fix. The reporter’s complete Intel Mac timeout was not reproduced. Is this the best way to solve the issue? Yes. Applying the existing candidate flag at the startup owners is a narrow solution that preserves normal startup and required validation, with relevant published-driver upgrade evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 69afbbaf3742. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…question-layout-restart-recovery-20260921 * 'main' of https://github.com/openclaw/openclaw: (110 commits) perf(infra): collect and retire idle worker heaps (openclaw#154408) perf(sessions): hand shared history to the final reader (openclaw#154552) fix: clarify Codex onboarding migration scope (openclaw#151383) fix: recover conflicted PRs after accepted auto-merge perf(update): defer Gateway maintenance during candidate validation (openclaw#154548) perf(test): advance llama.cpp reload deadlines virtually (openclaw#154536) refactor(skills): prepare pinned library resources off-thread (openclaw#148560) fix(tooling): preserve Node compiler policy in script subprocesses (openclaw#154509) ci: select supported Node and cover packaged Node 26 (openclaw#154298) fix(release): preserve Telegram rerun evidence (openclaw#154561) docs: follow pending PR merges through completion fix(gateway): avoid stuck shutdowns after lifecycle errors (openclaw#145241) fix(ui): let focused dashboard widgets fill the task area (openclaw#154440) feat(release): add non-Latest extended-stable releases (openclaw#154515) fix(release): project 7.35 package Telegram config (openclaw#154546) refactor(config): derive host contracts from schemas (openclaw#153936) fix(ui): remove finished subagents from inline activity (openclaw#154469) refactor(config): derive core channel contracts from schemas (openclaw#153935) refactor(config): derive boundary contracts from schemas (openclaw#153937) fix(ui): keep thread activity current across cached updates (openclaw#154540) ...
…penclaw#154548) Apply the existing candidate flag before session catalogs, worker recovery, and background lifetimes are prepared. Keep configuration, ownership, schema, migration admission, and plugin runtime validation intact. Prove the startup boundary and document manual recovery from the published updater's shared five-minute deadline. The published 2026.9.4 driver upgrades the synthetic ten-agent state successfully, with candidate readiness in 6.134s. Thanks to @ZaneMc-AO and the other timeout reporters. Related: openclaw#144858, openclaw#154381
What Problem This Solves
Candidate validation spends part of the installed updater's deadline preparing session catalogs and background maintenance that the canary never uses.
Related: #144858, #154381. Thanks to @ZaneMc-AO and the other reporters for the field evidence.
User Impact
Update canaries reach readiness without session catalog hydration, worker recovery, task/skill startup, or background maintenance. A warning records the deferral; the serving Gateway prepares these normally after activation. Required configuration, ownership, schema, and migration admission and actual plugin runtime loading remain intact. There are no new configuration, CLI, environment, dependency, or schema surfaces.
The reported 299-second failure measures the entire 2026.9.4 validation interval, including earlier checks; it does not establish five-minute Gateway startup. This synthetic baseline already met the requested 90-second target. This change removes unnecessary work and protects the candidate boundary; it does not reproduce the reporter's complete Intel Mac environment. Troubleshooting now links the one-time manual package-manager install, Doctor, and restart recovery for the old updater's fixed deadline.
Why This Change Was Made
The shipped
--update-canaryoption previously suppressed autonomous work late in startup. The existing bootstrap, request-runtime, early-runtime, and finish owners now apply it before preparing serving-only state. Normal Gateway startup retains its existing path. Production growth is 11 lines to select the existing candidate mode across those owners; no second startup implementation was added.Evidence
Matched packaged builds on one Linux Testbox with four effective CPUs, Node 24.19.0, ten agents/agent databases, and npm Codex, Mistral, and Groq plugins. The state was seeded with 53,664 synthetic transcript events; the copied main database was 222.4 MiB at Gateway spawn, after rehearsal, in both runs. Ownership/schema checks and plugin loading still executed.
These are one matched pair, not a statistical hardware guarantee. Nested spans are not additive. The direct-owner validation totals were 41.175 s and 40.083 s; that harness's Doctor lint correctly deferred inspection without a recognized updating-parent origin.
The actual published 2026.9.4 updater was also installed in a private npm prefix. Its own public SDK created ten schema-19 agent databases, with a 226.5 MiB main database; its Codex/Mistral/Groq packages were installed at 2026.9.4. Its unchanged updater then ran
update --tag <candidate.tgz> --yes --json --timeout 1800 --no-restart, retaining the released 300-second canary clamp. The full update returnedstatus: "ok", installed the candidate 2026.9.5 package, and reported 90.548 s overall. Candidate readiness was 6.134 s, with ten copied databases and a 225.1 MiB main database at spawn. No repair agent ran. Pending Codex migration and isolated-service-management warnings remained visible. This cell exercises migration/activation and canary readiness; it intentionally does not restart a managed service./startupzand/readyzwithout invoking the deferred owners.node scripts/run-vitest.mjs <file> --maxWorkers=1; 14.71 s Vitest duration (57% transform, 39% fixture/test time), HTTP assertions 29 ms. One shared real Gateway boot is needed to protect cross-owner startup wiring.check:changed(including core/core-test types), formatting, and diff checks passed. Final isolated autoreview found no actionable P0/P1 issues.Testbox proof:
tbx_01m318a9xvs8nr0em78fj770ea, run 35566135777, verified source treef5f7676ef164d78db7273ce80d0d0683b388e032. Earlier regression/sibling/build proof usedtbx_01m311md7n7zq7y20x3tnxc047, run 35559124184; those commands passed before the lease was subsequently cancelled during packaging. A replacement lease hit an SSH multiplexing error before command execution; the fresh retry with a smaller command payload succeeded. Initial plugin-name and legacy-roster fixture errors were corrected before counting the published-driver result.Testbox leases are stopped after evidence collection, so their Actions conclusion can show cancelled after successful commands; the recorded wrapper results above exited zero.