Repository navigation
fix(config): apply Gateway writes without waiting for file events - #157372
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 24, 2026, 2:07 PM ET / 18:07 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch makes running Gateway config writes publish validated snapshots directly, moves file observations into a shared config source, and routes config-journal access through SQLite workers. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main still has the watcher-mediated path, while this PR has credible direct Gateway proof and no identified code defect. The remaining question is whether the changed reload and lifecycle path requires published-updater compatibility proof. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway receives configuration from its write methods and from edits to the root or included files. Its reload owner applies valid changes to the running process, requests restarts when needed, and records journal diagnostics. flowchart LR
A[Gateway config write] --> D[Config source]
B[File edit] --> C[File watcher]
C --> D
D --> E[Reload planner]
E --> F[Running Gateway]
E --> G[Restart request]
D --> H[Config journal]
Decision needed
Why: The previous review required that cell, and the current patch still changes lifecycle reconciliation. The PR body reports coordinator approval, but no independent maintainer comment or review records the exception. Before merge
Agent review detailsSecurityNone. PR surfaceSource +161, Tests -86, Docs +19. Total +94 across 27 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the unified config source and demonstrate that a shipped updater preserves existing config, included files, and journal state when entering the candidate. Do we have a high-confidence way to reproduce the issue? Yes: delaying file events during a current-main Gateway config.patch call and comparing source and applied hashes targets the watcher handoff shown in source. This reviewer did not execute the pre-fix path. Is this the best way to solve the issue? Yes. A shared source for committed writes and file observations repairs the handoff at its owner; the shipped upgrade entry remains to be settled. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0eecafafa554. LabelsLabel changes: No label changes. Label 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
HistoryReview history (4 earlier review cycles)
|
6ebbd6a to
f2df171
Compare
Publish canonical snapshots directly from managed writers and keep external file observations under the same revisioned source. Preserve restart intent and application receipts through coalescing, file echoes, and retries. Move config file watching and recovery to the source adapter, share source reads, and move the reload journal onto the existing SQLite workers. Keep JSON5, includes, environment substitution, and config/storage/SDK contracts.
Keep config journal and audit inspection replies together without growing the shared worker dispatcher. Preserve query kernels, admission, cursor errors, and stored data.
f2df171 to
a876d27
Compare
|
Merged via squash.
|
* commit '926bb1e1d75c6b102bcbf93114c690312c23cf18': (2027 commits) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) fix(telegram): stop leaking raw file:// markdown links in messages (#137810) refactor(claws): share resource capability changes (#154680) improve(channels): reduce redundant preparation for button messages (#157050) fix(build): package preparation fails on unrelated test types (#157318) refactor(claws): share bounded document reading (#157436) ...
* refactor(config): share config doc wildcard traversal * refactor(config): refresh wildcard traversal on frozen main Integrate the frozen main baseline while preserving the documentation wildcard extraction and its public renderer coverage. * chore: merge main for config doc validation * commit '926bb1e1d75c6b102bcbf93114c690312c23cf18': (2027 commits) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) fix(telegram): stop leaking raw file:// markdown links in messages (#137810) refactor(claws): share resource capability changes (#154680) improve(channels): reduce redundant preparation for button messages (#157050) fix(build): package preparation fails on unrelated test types (#157318) refactor(claws): share bounded document reading (#157436) ... Co-authored-by: Vincent Koc <[email protected]>
* commit 'a0905dfe5c17053a3f0ef2aa0cf8f421bce9381c': (75 commits) fix: preserve conversation titles across split-pane agent switches (#157482) test(gateway): settle resumed work before checking announcement fix(update): avoid socket-arrival assumptions in deadline tests (#157504) fix(ci): include Android Access in release coordination refactor: share LINE message context test fixtures (#157488) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) ...
* commit '926bb1e1d75c6b102bcbf93114c690312c23cf18': (1903 commits) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) fix(telegram): stop leaking raw file:// markdown links in messages (#137810) refactor(claws): share resource capability changes (#154680) improve(channels): reduce redundant preparation for button messages (#157050) fix(build): package preparation fails on unrelated test types (#157318) refactor(claws): share bounded document reading (#157436) ...
* refactor(acp): consolidate scalar runtime option validation * chore: merge main for ACP validation * commit 'a0905dfe5c17053a3f0ef2aa0cf8f421bce9381c': (75 commits) fix: preserve conversation titles across split-pane agent switches (#157482) test(gateway): settle resumed work before checking announcement fix(update): avoid socket-arrival assumptions in deadline tests (#157504) fix(ci): include Android Access in release coordination refactor: share LINE message context test fixtures (#157488) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) ... Co-authored-by: Vincent Koc <[email protected]>
* refactor(agents): centralize tool description exclusions * Merge main into refactor/tool-description-exclusions-20260915 * commit '84114b5a2711764e2ca333e327e808fd88316063': (40 commits) improve(sessions): reuse compiled transcript metadata queries (#148773) fix(ci): repair Copilot contracts and config failure diagnostics (#149001) test: align model auth and setup fixtures with current behavior (#149023) refactor: reuse web search request context (#148949) fix(ci): remove duplicate Copilot auth metadata (#149016) test(agents): align auth fixtures with runtime store reads (#149004) improve: reduce data fetched during reminder maintenance (#148996) fix(cron): skip availability checks when session pruning is idle (#148920) fix(auth): guard GitHub Copilot device flow authority (#148999) fix(agents): prevent early recovery aborts of foreground exec (#148959) fix(github-copilot): remove retired Raptor mini (#116505) improve(feishu): reduce preparation work for documents with tables (#148997) improve: reduce database work when recording participants (#148841) test: accept Bun error labels in plugin assertions (#148955) fix(models): clarify saved account health and catalog status (#148987) test(plugins): align Copilot auth-choice registry expectations (#148981) fix(channels): reject blank integer channel add options (#145534) fix(ui): preserve archive undo after chat navigation (#148831) feat: show cited source previews in macOS and iOS chat (#148906) fix: avoid redundant tab updates while chats stream (#148865) ... * refactor(agents): consolidate tool description exclusions * chore: merge main for tool summary validation * commit '926bb1e1d75c6b102bcbf93114c690312c23cf18': (1903 commits) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) fix(telegram): stop leaking raw file:// markdown links in messages (#137810) refactor(claws): share resource capability changes (#154680) improve(channels): reduce redundant preparation for button messages (#157050) fix(build): package preparation fails on unrelated test types (#157318) refactor(claws): share bounded document reading (#157436) ... Co-authored-by: Vincent Koc <[email protected]>
…enclaw#157372) Gateway config writes could lose their immediate application path when a filesystem echo transferred the write's receipt and restart intent into debounced watcher work. Publish canonical committed snapshots through the existing runtime snapshot and committed-policy owners. One revisioned config source feeds the reload planner, and its file adapter owns external root/include edits and editor rename-replace events. Preserve pending restart requirements and the last good runtime across supersession and invalid edits. Move the touched reload-journal reads and writes onto the existing SQLite workers without changing the stored representation. Update behavior: existing JSON5 config, includes, environment substitution, journal state, backups, and rollback contracts remain unchanged. This change does not touch the updater, Doctor, service lifecycle, config/state migration, or plugin loading. A published-updater x candidate cell is therefore not required: an older updater's config write enters through the file adapter, which the isolated live proof already exercised. Validation: focused config/reload and journal suites, full changed checks, independent review, exact-head hosted CI, and isolated Gateway proof of immediate RPC publication, one publication per external/root/rename/include edit, invalid-config retention, and consistent restart state.
* refactor(config): share config doc wildcard traversal * refactor(config): refresh wildcard traversal on frozen main Integrate the frozen main baseline while preserving the documentation wildcard extraction and its public renderer coverage. * chore: merge main for config doc validation * commit 'e0f58a77476acbe382bff5e55cd520e9d228d478': (2027 commits) refactor(matrix): reuse startup verification account key (openclaw#157310) perf(config): avoid repeated environment scans during publication (openclaw#156457) chore(i18n): refresh native locales (openclaw#157495) fix(update): show quiet step progress and date recorded outcomes (openclaw#153407) feat(gateway): preserve browser sign-in requirements before connecting (openclaw#157454) test(scripts): await CLI admission fixture lifetimes (openclaw#157424) fix(ci): preserve consumer selection across core type stripes (openclaw#157373) fix(wizard): preserve typed plugin enum values (openclaw#127577) (openclaw#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (openclaw#157458) test: prebuild run-node signal fixture (openclaw#157478) refactor(exec): reuse approval policy rule keys (openclaw#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (openclaw#157365) fix(config): apply Gateway writes without waiting for file events (openclaw#157372) fix: count recorded nested tool operations once (openclaw#157438) fix(telegram): stop leaking raw file:// markdown links in messages (openclaw#137810) refactor(claws): share resource capability changes (openclaw#154680) improve(channels): reduce redundant preparation for button messages (openclaw#157050) fix(build): package preparation fails on unrelated test types (openclaw#157318) refactor(claws): share bounded document reading (openclaw#157436) ... Co-authored-by: Vincent Koc <[email protected]>
…#157446) * refactor(acp): consolidate scalar runtime option validation * chore: merge main for ACP validation * commit 'a2532ef8d2eb80fd2fd391ef7ea645c051f8be9c': (75 commits) fix: preserve conversation titles across split-pane agent switches (openclaw#157482) test(gateway): settle resumed work before checking announcement fix(update): avoid socket-arrival assumptions in deadline tests (openclaw#157504) fix(ci): include Android Access in release coordination refactor: share LINE message context test fixtures (openclaw#157488) refactor(matrix): reuse startup verification account key (openclaw#157310) perf(config): avoid repeated environment scans during publication (openclaw#156457) chore(i18n): refresh native locales (openclaw#157495) fix(update): show quiet step progress and date recorded outcomes (openclaw#153407) feat(gateway): preserve browser sign-in requirements before connecting (openclaw#157454) test(scripts): await CLI admission fixture lifetimes (openclaw#157424) fix(ci): preserve consumer selection across core type stripes (openclaw#157373) fix(wizard): preserve typed plugin enum values (openclaw#127577) (openclaw#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (openclaw#157458) test: prebuild run-node signal fixture (openclaw#157478) refactor(exec): reuse approval policy rule keys (openclaw#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (openclaw#157365) fix(config): apply Gateway writes without waiting for file events (openclaw#157372) fix: count recorded nested tool operations once (openclaw#157438) ... Co-authored-by: Vincent Koc <[email protected]>
…8966) * refactor(agents): centralize tool description exclusions * Merge main into refactor/tool-description-exclusions-20260915 * commit '4a994031abb1b54d51b76755a55ac8f6e918162d': (40 commits) improve(sessions): reuse compiled transcript metadata queries (openclaw#148773) fix(ci): repair Copilot contracts and config failure diagnostics (openclaw#149001) test: align model auth and setup fixtures with current behavior (openclaw#149023) refactor: reuse web search request context (openclaw#148949) fix(ci): remove duplicate Copilot auth metadata (openclaw#149016) test(agents): align auth fixtures with runtime store reads (openclaw#149004) improve: reduce data fetched during reminder maintenance (openclaw#148996) fix(cron): skip availability checks when session pruning is idle (openclaw#148920) fix(auth): guard GitHub Copilot device flow authority (openclaw#148999) fix(agents): prevent early recovery aborts of foreground exec (openclaw#148959) fix(github-copilot): remove retired Raptor mini (openclaw#116505) improve(feishu): reduce preparation work for documents with tables (openclaw#148997) improve: reduce database work when recording participants (openclaw#148841) test: accept Bun error labels in plugin assertions (openclaw#148955) fix(models): clarify saved account health and catalog status (openclaw#148987) test(plugins): align Copilot auth-choice registry expectations (openclaw#148981) fix(channels): reject blank integer channel add options (openclaw#145534) fix(ui): preserve archive undo after chat navigation (openclaw#148831) feat: show cited source previews in macOS and iOS chat (openclaw#148906) fix: avoid redundant tab updates while chats stream (openclaw#148865) ... * refactor(agents): consolidate tool description exclusions * chore: merge main for tool summary validation * commit 'e0f58a77476acbe382bff5e55cd520e9d228d478': (1903 commits) refactor(matrix): reuse startup verification account key (openclaw#157310) perf(config): avoid repeated environment scans during publication (openclaw#156457) chore(i18n): refresh native locales (openclaw#157495) fix(update): show quiet step progress and date recorded outcomes (openclaw#153407) feat(gateway): preserve browser sign-in requirements before connecting (openclaw#157454) test(scripts): await CLI admission fixture lifetimes (openclaw#157424) fix(ci): preserve consumer selection across core type stripes (openclaw#157373) fix(wizard): preserve typed plugin enum values (openclaw#127577) (openclaw#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (openclaw#157458) test: prebuild run-node signal fixture (openclaw#157478) refactor(exec): reuse approval policy rule keys (openclaw#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (openclaw#157365) fix(config): apply Gateway writes without waiting for file events (openclaw#157372) fix: count recorded nested tool operations once (openclaw#157438) fix(telegram): stop leaking raw file:// markdown links in messages (openclaw#137810) refactor(claws): share resource capability changes (openclaw#154680) improve(channels): reduce redundant preparation for button messages (openclaw#157050) fix(build): package preparation fails on unrelated test types (openclaw#157318) refactor(claws): share bounded document reading (openclaw#157436) ... Co-authored-by: Vincent Koc <[email protected]>
Main 6b2afbf conflicted in eight files. Resolution notes: - config-reload.ts: main moved source observation into src/config/source.ts (openclaw#157372) and write notifications now carry the writer's canonical reread (openclaw#161868). The observation tracker keys on source.observation.revision, the accepted-echo marker lives in config-reload-observed.ts, and the pending-write path records the notification's snapshot because it no longer rereads. config-reload-watcher.ts is removed: main dropped the polling resolver it held. - snapshot.ts: runtimeConfig sits beside main's childRuntime (openclaw#157190). - server-methods/health.ts: the capability projection wraps main's inlined cached-health object and its live childRuntime read. - server-connection-state.ts: the health event projection returns main's { payload } projection shape. - health.ts: the runtime-config line joins main's formatter loop. - connect-hello.update-scope.test.ts: makeContext takes { caps, client }. - config-reload.observation.test.ts: writes use makeWrite; the reread cases now drive the notification's snapshot, and the read-failure case is gone with the reread it covered.
What Problem This Solves
Gateway config writes could lose their immediate application path when their filesystem echo transferred the write's receipt and restart intent into debounced watcher work.
User Impact
Writes through the running Gateway now publish their resolved, validated snapshot directly, without waiting for a watcher event. External JSON5 edits,
$includechanges, editor rename-replace writes, reload modeoff, restart requirements, and last-good runtime behavior retain their contracts. Accepted source revisions identify write versus file admission in the log. No migration or operator action is required.Why This Change Was Made
Extend the existing runtime snapshot and committed policy owners: shared writer publication carries the canonical snapshot, including authored bytes, include ownership, and environment-resolution facts. One config source owns revisioned observations and shared reads; its file adapter owns the config watcher. The reload planner consumes those observations, preserves pending restart intent across supersession, and publishes policy only when runtime application commits. Explicit plugin lifecycle actions still reconcile their exact persisted target through that source.
The touched reload journal now uses the existing read-only and write workers. Its single-slot CAS, fingerprints, stored bytes, retention, and best-effort diagnostic behavior are unchanged. The narrow worker additions preserve the existing database and engine owners.
Cutover, size, update behavior, and contracts
Removed the reload controller's chokidar lifetime and recovery machinery, watcher-owned transfer of pending writes, duplicate observation reads, hash-only echo bookkeeping, duplicated writer-notification construction, and the unused path-filtered journal reader. Watcher recovery coverage moved to the file adapter; duplicate listener-copy and startup scaffolding were removed. The inventory found no additional config watchers or freshness polls to retire. Skills content watching remains with its existing owner.
The diagnostic worker extraction preserves audit replies and invalid-cursor behavior while satisfying the post-rebase line cap.
Measured against
origin/main...HEADusing the work order's source exclusions:This uses the work order's honest-growth escape hatch. Journal/worker plumbing accounts for net +134 production lines; the remaining source cutover and shared publication account for net +27. Authority checks, transactional rollback, receipt settlement, and synchronous CLI writer contracts remain intact.
Updates keep the same config files, include graph, environment substitution, backup/rollback path, and startup validation. Older updaters and separate CLI processes keep writing the existing format; those cross-process changes enter through the file adapter. Source revisions are process-local. There is no config option, config-format/schema change, database schema/version bump, retention change, or Plugin SDK surface change. The work order authorizes the internal storage-admission change; no persistent migration is introduced.
Evidence
Publication head:
6ebbd6ac86b1d5f617eae75325e7cbae420c12f2, based on4dbec4804a7cfc010b1759a22e8074219fecdbe1. All five commits remained patch-identical through the final rebase. Blacksmith Testbox proof passed 778 focused tests and the complete changed-file gate. The final rebase is patch-identical; journal/reload and live proof are refreshed on the publication head.Publication-head refresh passed 510 journal/reload tests and the full isolated live flow. Exact-head CI and
openclaw/ci-gatepassed; this PR remains unmerged for coordinator review.Remote commands, leases, and measured test costs
Provider:
blacksmith-testbox. Commands ran through Crabbox/Testbox withpnpm install --frozen-lockfilebefore tests/checks in synced checkouts. No local Vitest, tsgo, build, or Gateway execution was used.tbx_01m39aevhkb96qeqc1kfv4p5w5(run) — initial focused tests and live proof; its long changed-check attempt ended with SSH exit 255, so that attempt is not gate proof. The lease completed/cancelled.tbx_01m39gxyt33713zh7k34sdn8jw(run) — regression controls and final reload tests; later sync/base problems prevented a complete gate. Explicitly stopped.tbx_01m39pbee0fvgpk6tc32hzfj33(run) — canonical-reader/diagnostic tests and the full gate through typechecking and dead-export scans; lint then found five unbound-method errors, corrected below. Lease completed and explicit cleanup was verified. A targeted retry failed SSH after completion and executed no checks.tbx_01m39xm0qkvfmm8nh0vx3e12e9(run) (harbor-krill-0deb) — 778 focused tests and the full changed gate passed before the patch-identical publication rebase; 510 journal/reload tests, Markdown lint, and the complete live flow passed on the publication head. Stopped; native status verifiedcompleted.Each standalone measurement below used
pnpm test <file> --maxWorkers=1. Wall times include wrapper/compiler startup and are samples, not pure test execution time.src/config/source-file.test.tssrc/config/io.runtime-snapshot-write.test.tssrc/config/runtime-snapshot.test.tssrc/config/config-journal-snapshot.test.tssrc/config/io.write-journal.test.tssrc/config/io.write-config.test.tssrc/config/io.write-reread.test.tssrc/gateway/config-reload.test.tssrc/gateway/server-reload-managed-context.test.tssrc/gateway/server-reload-handlers.test.tsThe existing large writer suite protects persistence, includes, backup/rollback, and write authority; its startup cases moved to the journal suite. Adapter recovery coverage moved to its owning suite. CI seconds are the sum of Vitest-reported case durations, excluding compilation and suite/worker startup. Counts match each changed test file. The unchanged
server-reload-handlerssibling reports 267 of 269 durations because two fixture labels and timings were redacted by the log sanitizer; its value is a subtotal, not a full-file cost.Pre-publication focused proof on L4 (
1ae6797f8fde330f6fdefca66d3819f2bed3d0ee):pnpm test src/config/config-journal-snapshot.test.ts src/config/io.write-config.test.ts src/config/io.write-journal.test.ts src/config/io.runtime-snapshot-write.test.ts src/config/runtime-snapshot.test.ts src/gateway/config-reload.test.ts src/gateway/server-reload-managed-context.test.ts --maxWorkers=1Result: 488 Gateway and 263 config tests passed; 152.35 s command wall. The separate adapter/reread runs above add 27 cases. After the publication rebase, this command passed 487 reload and 23 journal/reread cases in 62.79 s:
pnpm test src/config/config-journal-snapshot.test.ts src/config/io.write-journal.test.ts src/config/io.write-reread.test.ts src/gateway/config-reload.test.ts --maxWorkers=1Diagnostic-shard proof also passed with:
pnpm test src/config/config-journal-snapshot.test.ts src/audit/execution-decision-cursors.test.ts src/audit/execution-identity-context.test.ts --maxWorkers=1Result: 32 audit and 5 journal tests passed; 68.65 s wall including cold preparation. Earlier sibling coverage passed 95 tests across
config-reload.activation.integration,server-reload-handlers.operator-model-policy,server-reload-channel-restart, andserver.config-patch.Full gate:
node scripts/check-changed.mjs --base origin/mainpassed on1ae6797f8fde330f6fdefca66d3819f2bed3d0eein 1873.94 s. It includes all core/test type graphs, lint, formatting, config-doc baseline, native schema, storage, import-cycle, and dead-export guards. That proof is retained across the patch-identical rebase; publication-head journal/reload and live evidence follow below. Markdown lint passed on the publication head (1309 files, zero issues). No SDK API regeneration was required.Live behavior and restart proof
L4 launched
pnpm --silent openclaw gateway run --port "$port" --bind loopbackwith an isolated home, state directory, config, workspace, synthetic token, and private port. RPCs usedpnpm --silent openclaw gateway call <method> --url "ws://127.0.0.1:$port" --token "$synthetic_token" --params '<synthetic JSON>' --timeout 60000 --json.With
CHOKIDAR_USEPOLLING=true CHOKIDAR_INTERVAL=600000,config.patchchangedmessages.ackReactionScopeand was applied/acknowledged in 1.935 seconds including CLI startup. The log recordedconfig source revision 1 accepted (write);config.getreported matching source/applied hashes.After restart with normal file detection, a root edit, editor-style rename-replace, and an edit to
logging.json5each produced exactly one file publication and the expected applied value. Invalid JSON5 produced no publication, loggedconfig reload skipped (invalid config), and retained the last applied hash. Restoring valid bytes, killing the owned Gateway with SIGKILL, and restarting preserved the settings and matching source/applied hashes. Live command result: exit 0.Publication-head live refresh: passed, exit 0, 67.41 s wall. With ten-minute watcher polling, the RPC produced only
config source revision 1 accepted (write)and matching source/applied hashes. Native file detection then recorded exactly one publication each for root, rename-replace, and include edits. Invalid JSON5 logged the rejection and published nothing; the last applied hash stayed intact. The harness sent SIGKILL to the actual Gateway PID, then verified settings and hashes after restart.An earlier refresh exposed harness process ownership: the pnpm wrapper exits before its detached Gateway, and SIGKILL cannot forward through the wrapper. The harness now identifies the owned Gateway PID from its startup record, signals that PID, and joins child stream closure. All owned processes from the interrupted fixture were cleaned up; no production change was needed.
Failures, regression controls, and review
Focused failures led to updated duplicate-read expectations, startup fixtures awaiting owner readiness, and corrected source/restart-intent handling. The producer test now checks the authored
${VAR}path and resolved-reference provenance instead of incorrectly expecting no environment fact.Negative controls failed for the original direct-snapshot path, lost active-write intent, startup-journal readiness, watcher-close cleanup, and pending external observations; the latter three-case control passed after repair. An intermediate batch retained an obsolete no-restart expectation after restart-intent preservation was repaired (482 passed, one failed). That test now verifies that the newest config applies while the earlier committed restart requirement survives; the final 487-test reload suite passed.
Changed checks found line-cap growth, pinned-formatting differences, and an unused journal reader; shared publication, coherent test/diagnostic extraction, pinned formatting, and deletion resolved them. The latest completed full attempt passed core/all core-test type graphs and all three dead-export scans with zero entries, then failed five unbound-method lint errors. The correction changes three adapter methods to lexical arrows and retains the test close spy (five lines changed each way, no net LOC growth). The subsequent complete gate passed without exceptions or skips. SSH, missing-base-ref, and sync failures supplied no passing gate evidence.
Codex autoreview: 10 attempts, 9 completed; 4 finding rounds and 5 clean rounds. Attempt 1 was unavailable (
refresh_token_reused). Rounds 2–5 identified restart-intent races, preparation/shutdown fencing, and a pending external observation; all were addressed. Round 6 was clean; full-branch rounds 7 and 9 were clean after diagnostic extraction and journal-reader deletion. Round 8 covered formatting; round 10 covered the five-line lint correction. Both were clean. No accepted/actionable finding remains.Exact-head CI: run 36021720956 passed on
6ebbd6ac86b1d5f617eae75325e7cbae420c12f2(152 jobs completed, no failed jobs). The requiredopenclaw/ci-gateand all other applicable checks passed. No CI retry or source change was needed. This PR remains unmerged for coordinator review.Maintainer review confirmed that a published-updater x candidate cell is not required: this change does not touch the updater, Doctor, service lifecycle, config/state migration, or plugin loading. An older updater's config write enters through the file adapter, already covered by the isolated live proof.
Deferred credentials work
Credentials migration remains separate. Auth profiles/legacy OAuth, Matrix, and Zalo already have store and migration owners. Remaining active files include WhatsApp's Baileys multi-file authentication and GitHub CLI configuration under
credentials/github.A follow-up should inventory active versus legacy artifacts by owner, migrate WhatsApp through its authentication adapter with crash/reconnect proof, retain or derive GitHub CLI files for that external-tool contract, and extend the existing Doctor receipts, backup, restore, and cleanup owners together. Moving the directory wholesale would cross those contracts.
Landing validation
The coordinator approved the owner cutover. After synchronizing with main, all five patches remained unchanged by range-diff. CI run 36033238816 passed on landing head
a876d273f902cad41cac78364c5cad7a3a831fb2.An earlier rebased run, 36026877058, timed out in
models-connect-publication.integration.test.ts: startup/connect consumed 55.375 seconds of its 60-second case budget, followed by a plugin-metadata cleanup error in the next non-isolated suite. The exact 14-file selector and eight-worker replay passed all 391 tests in 142.68 seconds on Blacksmith leasetbx_01m3a5avs1bhrbcdzxxsf711v5(run); the model-publication case took 9.828 seconds. This was non-reproduction, not a claimed fix.One diagnostic-only base/candidate comparison passed both cases: startup/connect was 20.168/25.672 seconds and the measured config-reloader readiness await was 5/9 ms. These single samples do not explain the CI startup outlier. No timeout, assertion, worker count, or production behavior was changed to obtain green. The diagnostic lease was stopped and verified completed. The failed attempt and cleanup uncertainty remain recorded under the repository's best-effort test-failure policy.