Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 11:19 AM ET / 15:19 UTC. ClawSweeper reviewWhat this changesThis PR moves memory-core’s dreaming-Cron recovery-owner setup into the gateway-start completion path and prevents the periodic reconciliation timer from being created after disposal. Merge readinessThe proposed lifecycle fix is narrowly scoped and its supplied exact-head evidence is strong: an initial managed-Cron list failure now reaches the existing recovery cadence without recreating recovery after shutdown. The PR is currently behind Priority: P2 Review scores
Verification
How this fits togetherMemory Core’s dreaming feature creates and reconciles a managed Cron job when the gateway starts, then periodically rechecks it. Gateway lifecycle events supply the Cron service and configuration; successful reconciliation produces a persisted managed job, while gateway stop clears its retry and interval owners. flowchart LR
A[Gateway start event] --> B[Memory Core dreaming handler]
B --> C[Initial managed Cron reconciliation]
C --> D[Recovery-owner setup]
D --> E[Periodic reconciliation]
E --> F[Managed dreaming Cron job]
G[Gateway stop event] --> H[Dispose retry and interval owners]
H --> D
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +125. Total +126 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase the focused two-file fix onto current Do we have a high-confidence way to reproduce the issue? Yes, at source level: the supplied regression setup makes the first Cron Is this the best way to solve the issue? Yes, subject to current-base refresh: using the existing timer owners in the startup completion path addresses the skipped-success-path failure without adding configuration, schema, or a parallel recovery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 35f035806baf. 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 |
…ming-startup-reconcile-recovery
|
Merged via squash.
|
…etwork-none * origin/main: (24 commits) refactor(sessions): isolate legacy transcript fixtures (#115231) fix(discord): clear pending launch watchdog (#115100) fix(agents): stop quadratic subagent prompt rendering (#115263) fix(memory-core): recover dreaming cron reconciliation (#115174) fix(qa-lab): filter incompatible channel scenarios (#115087) fix(android): respect locale in compact labels test(i18n): prove iOS discovery catalog ownership chore(i18n): refresh gateway discovery catalogs fix(i18n): include shared discovery copy in macOS catalog fix(apple): localize gateway discovery status chore(i18n): drop release-owned changelog entry fix(macos): localize privacy permission prompts fix(voice-call): bracket IPv6 webhook hosts (#115135) test(ci): split control UI scope coverage fix(ui): detect composed accessibility copy fix(ci): run localization checks for UI changes test(ui): catch untranslated accessibility labels fix(ui): localize chat action labels fix(ui): localize chat status indicators fix(ui): sync document locale metadata ...
…-20260728 * origin/main: (21 commits) refactor(sessions): isolate legacy transcript fixtures (#115231) fix(discord): clear pending launch watchdog (#115100) fix(agents): stop quadratic subagent prompt rendering (#115263) fix(memory-core): recover dreaming cron reconciliation (#115174) fix(qa-lab): filter incompatible channel scenarios (#115087) fix(android): respect locale in compact labels test(i18n): prove iOS discovery catalog ownership chore(i18n): refresh gateway discovery catalogs fix(i18n): include shared discovery copy in macOS catalog fix(apple): localize gateway discovery status chore(i18n): drop release-owned changelog entry fix(macos): localize privacy permission prompts fix(voice-call): bracket IPv6 webhook hosts (#115135) test(ci): split control UI scope coverage fix(ui): detect composed accessibility copy fix(ci): run localization checks for UI changes test(ui): catch untranslated accessibility labels fix(ui): localize chat action labels fix(ui): localize chat status indicators fix(ui): sync document locale metadata ...
* origin/main: (199 commits) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (openclaw#115264) test(migrations): avoid mtime precision in checkpoint fixture (openclaw#115269) test(signal): verify archive limits without malformed tar (openclaw#115270) refactor(sessions): isolate legacy transcript fixtures (openclaw#115231) fix(discord): clear pending launch watchdog (openclaw#115100) fix(agents): stop quadratic subagent prompt rendering (openclaw#115263) fix(memory-core): recover dreaming cron reconciliation (openclaw#115174) fix(qa-lab): filter incompatible channel scenarios (openclaw#115087) fix(android): respect locale in compact labels test(i18n): prove iOS discovery catalog ownership ...
Co-authored-by: IWhatsskill <[email protected]>
[AI-assisted]
What Problem This Solves
When memory-core's first managed dreaming Cron list operation rejects, the gateway logs the startup error but never starts the periodic reconciliation owner. That transient failure can therefore leave the managed dreaming job absent or stale until an unrelated runtime trigger or another gateway restart.
Failure mode
A Cron service can be present while its first
listoperation fails transiently. The startup catch logs that failure, but the old success-only timer setup leaves no periodic owner to retry the reconciliation.Why This Change Was Made
The gateway-start hook now arms its existing recovery owners in a finally path after the initial reconciliation settles. Runtime timer creation also checks the plugin's disposed state so a concurrent gateway stop cannot resurrect recovery after shutdown.
Root Cause
Both
startRuntimeCronReconcileTimer()andscheduleStartupCronRetry()were called inside the successful side of the startuptry. Any thrown reconciliation skipped both calls.Lifecycle boundary
Moving timer setup to
finallyrestores recovery after thrown startup work. The added disposed-state guard preserves the opposite transition: ifgateway_stopwins while startup reconciliation is pending, the completing startup hook cannot install a new interval.User Impact
Managed memory dreaming now self-heals after a transient startup Cron list failure on the existing 60-second cadence. Successful startup behavior, Cron-unavailable retries, managed job shape, runtime throttling, persistence, and gateway-stop cleanup remain unchanged.
Evidence
Exact-head proof is bound to
ff4b779b5b53261a2694bdd53fe3e1ffca51266c; expand the ledger for direct behavior, commands, preserved boundaries, gaps, and artifacts.Inspect exact-head proof ledger
Provenance
4f6fc38a22042ba3b08f04b9388864b3e4d4b149ff4b779b5b53261a2694bdd53fe3e1ffca51266cmainDirect behavior
registerShortTermPromotionDreaminglifecycle hook received a real startedCronService. Only its first reallistcall was fault-injected. Startup observed one failed list and zero managed jobs. At the observation made 61,258 ms after startup, the second list had run, the real service had created exactly one managed job, and the independently opened read-only SQLite snapshot passedintegrity_checkwith exactly one matchingcron_jobsrow. The productiongateway_stophook then completed. Result: PASS on exact merge headff4b779b5b53261a2694bdd53fe3e1ffca51266cwith no CronService, timer, or persistence double. Proves a transient first Cron list rejection no longer disables the periodic owner, and recovery reaches the real persistent managed-job boundary. Preserves the existing 60-second cadence, configured schedule, isolated target, agentTurn payload, no-delivery mode, SQLite schema, and gateway-stop lifecycle.Exact-head real CronService lifecycle proof
Automated verification
Focused lifecycle behavior
node scripts/run-vitest.mjs extensions/memory-core/src/dreaming.test.ts— 34/34 tests passed with 0 failures and 0 skips on exact merge head. Proves startup failure recovery, one runtime interval owner, the Cron-unavailable retry path, and gateway_stop preventing post-disposal timer creation. Preserves existing startup success, retry, throttle, idempotence, disabled-mode cleanup, and managed-job behavior.Static verification
./node_modules/.bin/oxfmt --check extensions/memory-core/src/dreaming.ts extensions/memory-core/src/dreaming.test.ts— both exact-head files matched the required format. Proves the merged two-file patch follows repository formatting. Preserves the bounded source and regression-test scope../node_modules/.bin/oxlint extensions/memory-core/src/dreaming.ts extensions/memory-core/src/dreaming.test.ts— 0 warnings and 0 errors across 212 rules on exact merge head. Proves the changed TypeScript satisfies the focused lint rules after the upstream merge. Preserves the existing plugin API and test contracts.git diff --check 4f6fc38a22042ba3b08f04b9388864b3e4d4b149...ff4b779b5b53261a2694bdd53fe3e1ffca51266c— exit 0 with no whitespace errors. Proves the exact current-main-to-merge-head patch is whitespace-clean. Preserves the bounded two-file manifest.Preserved boundaries
Proof gap
The scoped behavior is proved with the production memory-core lifecycle callbacks, a real 60-second timer, real CronService, and real SQLite persistence. The harness supplies only the plugin API registration/context and injects one first-list rejection; it does not bind a network listener or install a long-lived service because this patch changes neither surface. Separate add/update rejection scenarios and cancellation of a Cron operation already running at gateway_stop are not claimed.
Artifacts
REAL_CRONSERVICE_LIFECYCLE_PROOF PASS;exactHead=ff4b779b5b53261a2694bdd53fe3e1ffca51266c; startup list calls1; managed jobs after failure0; recovery observed by the61,258 mscheck; recovery list calls2; managed jobs1; SQLite rows1; snapshot pages376; gateway-stop hook invoked; mocked affected ownersnone. Separate read-only inspection returnedintegrity_check=okand the expected row.55ab6cc022806d1b5318b064e5ce2ac6a1d3f83acda236bf797d2478f566ff01; full terminal56fb57ebd974a250ad73d15b29aafac4eb8a4393033001e8a147a72644a52498; summarycfbfa38fc10d90166e90332369f00a6e175afc48ff4dc50fe798cb64f41fa707; self-contained SQLitebb6d9764e9f14e570c5680c3cb864201bdc2405c71c1164762659e0f8f946ab5; inspector9d9d61c8372caed3289aad4902b5560ca1901fe89587862a2fed4e203350cf8e; inspection output764b48c77a5022aa12a84408af6dd2161c025b718d0fbcd1e394b1eecb1f9673.node scripts/run-vitest.mjs extensions/memory-core/src/dreaming.test.ts;Test Files 1 passed (1);Tests 34 passed (34);[test] passed 1 Vitest shard in 16.33s. Terminal SHA-256b83eba0df0066347d5ddd2188834822dbc74a43e6b7fed55f4a02fe70c293c2b.