Repository navigation
improve(gateway): load cron only when reload requests it - #143500
Conversation
Defer the cron builder import to the existing restartCron branch and revalidate reload ownership after loading, watcher preparation, and at publication. Preserve candidate inputs and committed predecessor draining. Validation: 95 unique passes across scoped runs, not a full final-head rerun: 11 before the mechanical fixture correction, one corrected retry, 57 siblings, and 26 selected cases with 252 skipped. Scoped lint and formatting passed. Protected autoreview remains blocked before capture by its required-context dataset policy. No review verdict or merge qualification; complete-source build and broader checks remain pending.
|
🦞👀 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 15, 2026, 3:38 AM ET / 07:38 UTC (Revision 3). ClawSweeper reviewWhat this changesDefers loading the Gateway’s cron scheduler until a reload requests a rebuild and rejects canceled or superseded replacements before publication. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused improvement absent from current main. Source review found no actionable defect; the maintainer-authored PR remains open with its acknowledged qualification gaps. Priority: P3 Review scores
Verification
How this fits togetherGateway reload handlers translate configuration changes into runtime updates. Cron rebuilds prepare a replacement scheduler, publish it, transfer eligible watchers, and drain the previous scheduler. flowchart TD
A[Configuration change] --> B[Reload plan]
B --> C{Cron rebuild requested?}
C -->|No| D[Apply other runtime changes]
C -->|Yes| E[Load scheduler and prepare replacement]
E --> F{Reload still current?}
F -->|No| G[Reject replacement]
F -->|Yes| H[Publish scheduler and drain predecessor]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +278. Total +293 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep cron construction within the existing reload owner, with deferred loading and current-generation checks preserving scheduler and watcher continuity. Do we have a high-confidence way to reproduce the issue? Not applicable as a user-facing bug reproduction: current source directly shows the eager import being removed. No runtime execution was performed in this read-only review. Is this the best way to solve the issue? Yes. Moving the import into the existing rebuild branch avoids a competing scheduler owner, and the added checks cover the new asynchronous boundary without changing settings or persisted data. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7dcdb14e8435. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review The cron reload repair is now integrated with current main at signed head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
|
Final qualification clarification for f9ccd87: The squash description retained historical partial-validation notes. Those are not the final qualification for reviewed head
The PR body records the final source/tree/build identities and proof. No source, commit, signature, or native completion receipt was rewritten. |
* commit '0945dabbe487213e95e84a72ad1aae3659e0e000': (115 commits) fix: omit automation service aliases from squash coauthors (#148883) test: restore services typecheck shard headroom (#148885) perf(trajectory): avoid native probes for truncation records (#148870) improve(gateway): load cron only when reload requests it (#143500) fix: resolve issue #146088 — [Bug]: The most recent Linux AppImage does not ship with the correct versions of libs needed to run (#148174) refactor(theme): share nonvirtual ANSI color lookup (#148717) perf(gateway): scope exact session row topology reads (#148836) improve(memory): reduce vector replacement overhead (#148201) fix(i18n): keep HTTP headers out of native translations (#147119) refactor(plugins): share source-root display formatting (#148646) fix(cron): reject blank script paths before mutations (#148787) refactor(config): share audit positional scanning (#148643) fix(test): restore infrastructure typecheck shard headroom (#148861) fix(release): harden package validation fallbacks (#148729) refactor(config): share leaf and descendant unset pruning (#148216) test: reuse prepared runtime for pristine preflight (#148858) fix(ui): settle global model drafts across agent switches (#148843) fix(queue): avoid repeated scans when cancelling backlogs (#148754) fix(logging): orphaned \\\\?\\ path markers corrupt redacted Windows diagnostics (#147542) refactor(hooks): share optional reply metadata projection (#148641) ...
…3500) Defer the cron builder import to the existing restartCron branch and revalidate reload ownership after loading, watcher preparation, and at publication. Preserve candidate inputs and committed predecessor draining. Validation: 95 unique passes across scoped runs, not a full final-head rerun: 11 before the mechanical fixture correction, one corrected retry, 57 siblings, and 26 selected cases with 252 skipped. Scoped lint and formatting passed. Protected autoreview remains blocked before capture by its required-context dataset policy. No review verdict or merge qualification; complete-source build and broader checks remain pending.
What Problem This Solves
Gateway reload-handler initialization loads cron execution even when no cron restart is requested. Deferring that load also needs to keep canceled or superseded reloads from publishing stale cron state.
User Impact
Reload handlers can initialize without loading cron execution. Cron reloads retain their watcher handoff, candidate environment, and recovery behavior. No configuration, schema, protocol, dependency, migration, or operator action changes. No measured latency or memory improvement is claimed.
Why This Change Was Made
Load the builder inside the existing cron-restart branch. Recheck the live publication and reload generation after loading, after watcher preparation, and immediately before synchronous publication. Keep the existing invoker check before plugin publication and state selection.
An already-committed replacement still drains its predecessor even when newer work supersedes it. Replacement watcher adoption and startup remain current-owner-only.
Evidence
Current qualification date: September 15, 2026. Main integration base:
76aa544c38c4746936c1aafa5a79e8cb9ea6bc8d. Signed candidate head:7d6aad10267b7ce451e35cd72b8fb2a3902aff20; integrated main without rewriting the existing PR history.Set<unknown>was corrected with its existing typed callback contract; the Gateway test graph then passed.pnpm buildpassed on Linux x64, Nodev24.19.0, using configuredblacksmith-testbox. The complete source tree was verified asd872b48c96c3587b984751218c406942eb648293, matching the signed candidate.Latest ClawSweeper revision 3 reviewed this exact head on September 15, 2026 at 07:38:54.348 UTC; the durable comment was updated at 07:39:48 UTC: #143500 (comment). No source/security findings. Its two remaining proof items and sole Rank-up move are fulfilled by the complete build and isolated operator results above.
Remote proof: provider
blacksmith-testbox, leasetbx_01m2hz2130qf74wz0m19kw02ez, provisioned by https://github.com/openclaw/openclaw/actions/runs/34941277179. Full build finished at 07:45:27 UTC; operator proof finished at 07:48:51 UTC; the normal wrapper closed with exit 0. The workflow provisions the lease; the delegated command result is the proof, not the workflow's eventual cleanup status.The build stamp is
builtAt=1789458250292, carrier5d9d8b0a769af46893cd4d0872527ad80a76763d. Operator-only retry used normal full-source synchronization, verified the same candidate tree and original successful build record, and required the stamp to remain identical. Its source carrier was4b81aefd857017d1d7ee4e4197c9073501ff6ee5; no build was fabricated or repeated.{"build":"PASS","operator":"PASS","sameGatewayProcess":true,"sameCronStore":true,"storeOwned":true,"storage":"sqlite","watcherStarts":1,"completionObserved":true,"disabledAndReenabled":true,"shutdownExitCode":0,"ownedProcessesClosed":true}Protected autoreview remains BLOCKED/UNRUN: its filename admission guard rejects required
src/gateway/server-reload-managed-secrets.tscontext before engine execution. No automated clean-review verdict exists, and no scanner, filename, isolation, or helper guard was changed. The maintainer explicitly approved independent complete-source review, fresh ClawSweeper review, and full proportional validation as the substitute for this PR.Production delta is +16/-1 (net +15), needed for the deferred import's new awaited owner boundary and current-owner checks. Tests add 278 lines. All three changed files remain within the original cron reload owner.
Historical proof, not current-head qualification
The September 9 candidate was
ac9dbb0887859e9ee05850dff66e41c2a24b40e3, based on8642c68b6b9f6ee42fa91641dd8656fcf0a617a9. Earlier scoped results and the original autoreview admission failure remain historical evidence; they are not being counted as current-head build, CI, or operator proof.The September 15 local source transfer initially failed with ENOSPC before testing. Only its own incomplete pack was removed; a bounded transfer then succeeded. The failure is retained separately from test results.
Two initial Testbox attempts failed local staging/lease-claim writes before remote payload execution. Task-owned RAM staging and narrowly verified task-owned cache recovery allowed the unchanged supported route to proceed. Provider, source verification, ownership guards, and the staging-space minimum were not bypassed.
The first private operator probe reintroduced retired config fields after startup normalization, so the Gateway correctly rejected its invalid reload. All owned processes closed. Only the private probe was corrected to the current schema, rereading canonical startup config/meta and using supported
cron.skipMissedJobsas the same-store reload trigger. The second probe passed against the verified unchanged build. Product source and regression tests stayed at the signed candidate throughout.