Repository navigation
Conversation
|
Codex review: blocked before merge. What this changesAdds an optional, capability-gated health diagnostic comparing running configuration with the reloader’s latest completed source observation. Example: With gateway.reload.mode="off", an operator adds an unused gateway.auth.password while the Gateway continues using its loaded configuration.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR adds useful CLI diagnostics absent from main, with no actionable correctness finding; Gateway-owner acceptance of the public contract and enforced security approval remain unresolved. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Gateway reloader publishes completed source observations, and the shared health owner compares them with runtime snapshots before serving redacted diagnostics through CLI RPC, hello, and events. flowchart TD
A[Configuration changes] --> B[Config reloader]
B --> C[Completed source observation]
D[Published runtime snapshot] --> E[Shared health owner]
C --> E
E --> F[Client capability projection]
F --> G[CLI health and Gateway clients]
Technical reviewBest possible solution: Have Gateway owners settle the optional health contract, retaining the shared observation owner and negotiated legacy-client compatibility if accepted. Do we have a high-confidence way to reproduce the issue? Main’s health owner does not compare loaded and observed configuration; the supplied isolated-Gateway trace demonstrates the proposed diagnostic on a mode-off edit. Is this the best way to solve the issue? The proposal uses the reloader for source observation and the existing health owner for publication, preserving legacy payloads through capability negotiation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4b065f50d724. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +436, Tests +1304, Docs +22, Other -3. Total +1759 across 29 files. Added test files: 4. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (51 earlier review cycles; latest 8 shown)
Reviewed October 20, 2026, 5:30 PM ET / 21:30 UTC (Revision 52). |
54af744 to
b069b83
Compare
b069b83 to
4f42877
Compare
|
Status update (2026-06-08): pushed Rank-up move 1 (redacted real-behavior proof)Captured on a sandbox gateway on this Mac (loopback port 28790, dist built from this branch). Scenario: gateway started with Before the disk edit: {
"state": "ok",
"liveSourceFingerprint": "ZwpkNbonhuhHUcZIX-RpCpmDO_T0pI9-mhfmpnEx0Cw",
"diskSourceFingerprint": "ZwpkNbonhuhHUcZIX-RpCpmDO_T0pI9-mhfmpnEx0Cw",
"liveDefaultModel": "openai/gpt-5.5",
"diskDefaultModel": "openai/gpt-5.5"
}After the disk edit, before any restart: {
"state": "drift",
"liveSourceFingerprint": "ZwpkNbonhuhHUcZIX-RpCpmDO_T0pI9-mhfmpnEx0Cw",
"diskSourceFingerprint": "bmf1fqlb1l44OQU6Q71ZlZHQZwVl7pFQ9ZO_G11lzzE",
"liveDefaultModel": "openai/gpt-5.5",
"diskDefaultModel": "openai/gpt-5.5",
"driftPaths": ["gateway.auth"],
"message": "Live gateway runtime config differs from disk for model/provider/auth paths; restart is required or pending."
}Text-rendering path: The fingerprint values are visible here because the Rank-up move 2 (gate or remove config fingerprints from non-admin health output)
Implementation in Rank-up move 3 (resolve hot-mode semantic change)Split off to PR #89517 so this PR is purely about drift detection on the health surface and contains no upgrade-sensitive runtime-policy change. With Additional fix while capturing proofThe earlier draft listed Happy to add an explicit |
4f42877 to
eb88804
Compare
|
Follow-up to the 2026-06-09 02:20 UTC re-review (pushed P1 finding — Gate fingerprints on sensitive health snapshots (
|
eb88804 to
305b321
Compare
Rebased onto upstream/main (2cb62af). The pre-rebase hash (98845c86) was built from a stale base; regenerating with plugins:assets:build on the rebased tree converges to main's current 47a66f39. plugins:assets:check passes.
|
This pull request has been automatically marked as stale due to inactivity. |
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.
…ng module The line-cap ratchet rejects any growth in config-reload.ts. The observation wiring adds counted lines there, and the polling resolver this branch used to move out for the same reason no longer exists on main. The external-change audit appender only reads the watched path, so it moves verbatim to config-reload-audit.ts and the file ends below main's count.
applyPluginLifecycleChange reads and applies the config source outside runReload. It can consume a pending write and accept that write's watcher echo, and accepting the echo clears the queued reload, so nothing published the source it applied: health kept comparing the new runtime config with the previous observation and reported drift on a monitored path. The operation now records its read on the same per-transaction tracker as runReload and publishes it in its finally while its revision, or an echo it accepted, is still current.
|
Merged Publish plugin lifecycle reads to the health observation (P2,
Merge. GitHub had the branch at CONFLICTING. Eight files conflicted and one auto-merged file no longer typechecked:
Line cap. Checks on
The two red test jobs on Still open for Gateway owners: whether @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…atchet Main's check:test-mock-exports (openclaw#164673) arrived with the merge and rejects six mock factories this branch adds or changes. The two health-state mocks now pass the real module through. The config, device-bootstrap, setup-completion and health-owner mocks stay closed because isolating that state is their purpose, and each says so in a mock-isolation line. The baseline drops the four entries those edits retire.
…gnostic reads The cached health RPC branch reads the shared snapshot, then awaits the delivery-queue and context-engine summaries. A config observation or runtime publication that completes during those awaits retires the snapshot, but the handler still answered from the captured copy, so a client advertising runtime-config-health could receive the old `ok` after the owner had already rejected that cache. The handler now rereads the shared cache after the awaits and answers from a refresh when the snapshot it captured is no longer the current one.
One only asserted the arguments passed to a replaced builder, which the publication and hello-projection cases already pin. The other two made the mocked builder change the observation or the runtime revision in the middle of a synchronous comparison, which the real builder cannot do. The deferred whole-collection case keeps covering the asynchronous publication boundary.
|
CI on
Recheck cached health after awaited diagnostic reads (P2, Low-value tests. The other three red jobs
Checks on @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
config-reload.ts: take main's renamed candidates (GatewayConfigReloadCandidate, activeConfigCandidate, retryCandidate) and its finally-block cleanup, and keep the reload observation tracking around them; main removed the in-transaction echo catch-up from applySnapshot, so the observationReads cache and the acceptEcho call go with it. config-reload-observed.ts: drop acceptEcho, which lost its only caller; a watcher echo's own reload pass now reads and publishes the source (observation tests updated to say so). health-state.ts: keep main's completion-order publication without generations, published through publishPublicHealthSnapshot with its config key. health-state.test.ts: keep this branch's runtime-snapshot mock, which already spreads the real module as main's does. connect-hello.ts: keep main's remote Control UI ingress import and helloWriteStarted, after this branch's health finalization. connect-hello.update-scope.test.ts: keep both mock sets; HelloOk becomes a type import now that main dropped the GATEWAY_SERVER_CAPS cases. snapshot.test.ts: keep main's trimmed suite plus this branch's runtime-config health case.
src/commands/health.plugins.test.ts: keep main's shared health.test-fixtures.js import beside this branch's installHealthConfigMock import.
Merge pinned main while retaining runtime-config capability gating, health-event deduplication, and hello health opt-out. Publish config health in the same synchronous frame as its final generation check. Focused Gateway tests: 88 passed. Core and Gateway server test TypeScript checks, targeted lint, workboard assets, and scoped P0-P2 autoreview passed. A pre-fix regression reproduces stale health publication after the observation generation advances.
|
Updated to Fresh CI and maintainer security approval are still pending. The old SIGKILL/137 remains an unexplained failure, not an OOM diagnosis or a proven fix. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge pinned main to resolve hello capability conflicts. Compose runtime-config and summary filtering in the per-recipient owner, and fence health snapshots by runtime publication identity so reset/republication cannot reuse a revision key.
|
Pushed Final tree New-head CI is queued. Maintainer security approval and the Gateway-owner contract decision remain open. The historical SIGKILL/137 cause remains unknown. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Main 784d9ce conflicted in two files. server-methods/health.ts: keep this branch's respondFresh path and runtime-config client filter, and add main's live coreReady (openclaw#180924) to both the cached and the fresh response objects inside the filter. server/health-state.ts: keep this branch's config-key fenced collection loop, and pass main's cronStorePath (openclaw#180875) to its collectGatewayHealthSnapshot call.
Merge upstream main at 1d9da0d to pick up the startup readiness fixtures from openclaw#181700 and openclaw#181816 and the current test runtime.
What Problem This Solves
Fixes:
openclaw healthreportsokwhen the running Gateway still uses an older model, provider, auth or secrets config than the one on disk, for example after an edit undergateway.reload.mode: "off", a failed reload, or while a required restart is pending.The diagnostic also compared only
secrets.providers. Changingsecrets.defaults.env, which selects the active provider alias, therefore produced a falseokresult even after the reloader completed the new source observation.User Impact
openclaw health --jsonincludes optionalruntimeConfigstate:ok: monitored runtime values match the latest completed reload observation.drift: they differ, with redacted path names and default-model labels.unknown: one authoritative source is unavailable.Text health prints a warning for
driftorunknown. The diagnostic never emits config fingerprints, secret values, source paths, parse excerpts, or observation errors.openclaw healthadvertisesruntime-config-health. Every other client (Control UI, native apps, nodes, third-party v4 clients) receives hello,healthevents, andhealthresponses withoutruntimeConfig, the same shape as main.Since #111527,
hotand every mode other thanoffresolve tohybrid, so lasting drift now mainly comes frommode: "off", failed reloads, writes whose writer skipped runtime application, and restarts that are still pending.Update behavior: no config, default, SQLite, migration or protocol-version change. A new CLI talking to an older Gateway sends a capability that Gateway ignores, so the field and the text line are simply absent; an older CLI talking to a new Gateway doesn't advertise it and sees today's payload.
Why This Change Was Made
The config reloader owns one generation-fenced, immutable latest-completed source observation. The shared health owner compares that observation with the published runtime source snapshot. RPC, connection hello, broadcasts, cached health, and CLI text all read the same redacted projection. Monitoring canonical parent
secretscovers provider declarations, provider-default selection, and the restart-owned egress proxy without adding another config or API surface.Every reloader transaction that reads the source publishes that read when it finishes, and only while its source revision is current. A write's own same-source watcher echo is published by the echo's reload pass: main removed the in-transaction echo catch-up in #168980. That covers watcher reloads, in-process writes (which publish the canonical reread their notification carries), and plugin lifecycle applications.
The alternative was to read disk or reconstruct reload state in each health consumer. That would duplicate policy and recreate mixed-generation results during debounce, in-flight reads, supersession, and bootstrap awaits.
runtimeConfigis sent only to clients that advertise theruntime-config-healthclient capability, so existing strict v4 decoders never see it (details under Protocol compatibility).Protocol compatibility
An ungated field is rejected by the pre-change strict v4 decoder. Measured at
a78f6e3c2fdwith its own lockfile: that head'ssendGatewayHello, carrying a drift value from its realbuildRuntimeConfigHealth, validated with TypeBoxValue.Checkagainst the pre-change strict v4 decoder (snapshot.tsbyte-identical tobf83a4dde8f;frames.tshas no diff between base and head, soHelloOkSchemais the same with the base snapshot swapped in):So the field is capability-gated. It uses the negotiation the protocol already has (
GATEWAY_CLIENT_CAPSinclient-info.ts,ConnectParams.caps,hasGatewayClientCap) and adds one entry,RUNTIME_CONFIG_HEALTH: "runtime-config-health". The field is projected per connection on all three surfaces:healthevents: through the broadcaster's existing per-recipient projection hook inserver-connection-state.ts. The node-subscription fanout has no per-client caps in scope, so it always drops the field.healthRPC: both the cached and the refreshed response.The shared health cache is never mutated by the projection. The closed
HealthSnapshotSchemais reachable only through hello-ok'ssnapshot: thehealthRPC result already carriesmodelRuntime, which no schema inpackages/gateway-protocoldeclares, and I found no payload schema there for thehealthevent. I gated all three anyway so a client never sees the field without asking for it; a hello-only gate would be about 20 production lines smaller.Which contract to keep is the Gateway owners' call, and nothing here claims that decision. One set of data points for it, each measured with
git show <sha> | grep -E 'GATEWAY_CLIENT_CAPS|hasGatewayClientCap'(0 hits each): main has added optional fields to closed v4 hello-snapshot objects without a capability gate, for examplesuspensionin #136220 (e0ab9907621), presenceclientIdin #145559 (0141569e798), healthingressFailed/ingressPressurein #123234 (b233ea79575), and, since the last review, healthchildRuntimein #157190 (92c86fefcd4).Evidence
Current revision: October 24
Pushed
74a5bb3048320571d7be4f5234ffabcb1c1c9a64, tree3e50c559c9bd4a15d57f2dfd5130e6d6fcb021de, by a normal push after verifying the remote still held24431ac4acf68f7508e389126588782e33004ca6. The merge preserves that head and upstream1d9da0d5dce9ea92065015cb5de0671d2e68db8bas parents. It picks up the public-startup readiness fixture repair in #181700 and the worker-recovery fixture repair in #181816.The previous CI run 39971742215 executed merge
43cbeb2d78a66105d5293779dd0f75581e3ef5cewith actual basebe6b43f3c52b5e6b53504312554287135c302283. Replayed the original selected groups on those exact sources before testing the candidate:hello.okwithUNAVAILABLE, reasonstartup-sidecars.server.close; a later suite could not acquire plugin metadata while shutdown remained pending. This is a baseline cleanup failure, not a reproduction of the watchdog termination.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfoexited 0.These runs used Linux, Node
24.22.1, pnpm12.15.0, pinned Bun1.4.4-canary.1+ef37c31de, frozen installs, and one test worker. The base and merge have byte-identical dependency inputs and used Vitest5.0.3; the candidate's integrated main uses5.0.5. The candidate passed the replay, but the watchdog's cause has not been isolated. Hosted CI used two workers, so the local controls do not reproduce its concurrency. Source-tree guards passed around every candidate run.The original group plans are recorded in hook job 120476682644, worker job 120476682315, and runtime-config job 120476682472. Replays used each logged
OPENCLAW_NODE_TEST_GROUPS_JSONthroughnode --import tsx scripts/ci-run-node-test-shard.mts, withOPENCLAW_CI_TEST_RUNTIME_POLICY=bun-all,OPENCLAW_NODE_TEST_PLAN_CONCURRENCY=1, the one-worker override, andOPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000.The focused candidate command was:
Fresh source review covered all 29 complete patches and 70 hunks against pinned main, with no actionable P0-P2 finding. It used patch context and did not execute these tests. The committed tree matches the reviewed and tested tree.
Current-head CI run 40126705412 is running. At
2026-10-24T19:46:10Z, the complete capture contained 49 check runs: 13 successful, 21 skipped, 15 in progress. These are incomplete CI results. The separateopenclaw/ci-gateandopenclaw/security-sensitive-reviewcommit statuses require fresh maintainer approval; the notice names this exact head. The Gateway-owner contract decision remains open.Earlier measurements below are historical author reports at the SHAs they name. They are not current-head proof.
Historical revision: October 20
Pushed
426d7295459be24e2d18d968f6dc8f1411e4abf2, tree9190bd4b0c36a0219455cec5566bedf0b9b65b4c, as an additive merge of832a0c2cffae34863248e9d29a44925995148a04and upstreamf629720edbb9f4b458adae30c7506c1dc5d1adc6. The normal push and remote head were verified. CI run 39499291024 completed successfully: 112 jobs, 89 successful and 23 skipped, with no failed, running or queued jobs. The fully paginated capture at2026-10-20T23:42:26.369785+00:00recordsfilter=all: 180 completed checks (1 neutral, 57 skipped, 122 success);filter=latest: 180 completed checks (1 neutral, 57 skipped, 122 success). The preflight job checked out merge5c19327872dac9e8382503fe89163559452f54b4, tree29fc941f9313770bccb92a973fad06d5fdd00492, with parents8f0973e37405d683e242e217f4d7c30a1efc4118and this head426d7295459be24e2d18d968f6dc8f1411e4abf2. That executed merge differs from the locally validated integration tree. The last queued shard is included in the terminal result.The integration preserves upstream health-summary and hello-on-demand behavior alongside the optional runtime-config capability. It also fixes two demonstrated defects:
agentsandsessionsafter the broadcaster had removed them for a summary-only client. The existing per-recipient callback now applies both projections before serialization. The generic broadcaster matches pinned main. Production callback, eight serialized-event combinations.The hello table covers all 16 combinations of cached health, runtime-config capability, hello-on-demand and health-summary capability.
Executed on the private Linux builder with Node v26.8.2, pnpm 12.12.1, frozen dependencies and one Vitest worker:
f84da04ee18080546e35ac732673768b22516d81runtimeConfigpresent; the absent case passed, eight unrelated cases skipped. The loop stopped at its first affected recipient, so this is one observed failure. Exit 1, 144.13 seconds, no timeout.de0fdb18b3033c0876e41a261bb4d65e1d89ee629190bd4b0c36a0219455cec5566bedf0b9b65b4cReproduce the positive set:
For the event negative control, retain the final tests and remove only summary composition from the runtime-config per-recipient replacement, then run the connection-state cases. For the reset control, retain the tests but replace publication-identity comparison with the old observation-generation/numeric-revision key, then run the two reset cases. Restore the exact production bytes after each control. Neither mutation is in the branch. The final runs reported no remaining process-group children; tracked-blob checks do not certify untracked files or the entire runtime environment.
The integration includes upstream
b6bd9e8bd0cad400b31a223a0c44f8494f5cfb87, which fixes the missingcreateDeferredCoreimport reported by the previous head's static jobs. Those old failures also occur in the exact-base main CI; the old runtime jobs completed. The earlier SIGKILL/137 remains unexplained and is not classified as OOM.The fresh hosted review completed October 20 at 21:30 UTC on
426d7295459be24e2d18d968f6dc8f1411e4abf2, against main4b065f50d724f380dca1fa09b387c2b0e42a80a0, with zero findings. It accepts the supplied historical Gateway proof and current regression evidence. This was source inspection, not an independent execution of the target code. Its two remaining items are Gateway-owner acceptance of the capability-gated health contract and current-head maintainer security approval. Primary CI is now complete as recorded above. The separateopenclaw/security-sensitive-reviewand aggregateopenclaw/ci-gatecommit statuses remain failure;openclaw/dependency-reviewis success.Maintainer security approval and Gateway-owner acceptance of the optional
runtimeConfigcontract remain open. A successful Security Review workflow does not grant the required approval. The historical sections below retain their original heads and are not new executions at426d7295.Historical integration: October 19
Head
832a0c2cffae34863248e9d29a44925995148a04is an additive merge of the previous head56b8e57fe36d33313e80af541820b11e02ab9a2eand upstream main2cd23b665868c75bfb02537cef9eb9f2b329667a. GitHub reports the conflicts resolved. No rebase or force-push.The six conflict resolutions retain main's health-event deduplication, pinned config paths, connection-row delivery-loss handling, and
hello-health-on-demandbehavior alongside this PR's runtime-config capability gate. Clients advertising both health capabilities receive an empty hello health snapshot; requests and events still carry the opted-in diagnostic. The hello tests cover all eight combinations of cached health, runtime-config capability, and hello opt-out.A new health-owner regression reproduced an old
okdiagnostic being broadcast after its observation was superseded. The pre-fix resolved tree was022244e3589d615e8b58745e6ab6ca9cd7edb9c8; it failed withexpected generation: 7, received generation: 8while both values carriedstate: ok. The fix removes the async helper hop between the final config check and publication. A separate regression checks that an equivalent diagnostic at a newer generation refreshes the cache key without another event.Local author-run validation of the current tree (
a08c6662c26a9fb90f366284fadae4dceec13144):git diff --checkagainst pinned main: passed.autoreview: three completed passes,scoped-cleanthrough P2 on the full candidate diff against pinned main. The reviewer assessed supplied patches and did not execute tests. Helper SHA-256:b95e51b79d9f68fe445cdc9d6c1e07b01507188bba1bfe8a59f14c378e5ac3a5.Reproduce the focused runtime checks from this head with its frozen dependencies and repository test wrapper:
Exact-head CI run 39320268759 finished with two failing jobs plus the aggregate gate, both in a file this PR does not touch.
check-test-types-core-4:src/gateway/local-http-probe.test.ts(154,25): error TS2304: Cannot find name 'createDeferredCore'.check-lint-core-1:src/gateway/local-http-probe.test.ts:178:53(prefer-promise-reject-errors). #177670 (2cc639d7023) broke that file on main andb6bd9e8bd0cfixed it at 2026-10-19 21:24Z; the run's base0548086d6a95predates the fix. Every other job passed or was skipped, so the earlier SIGKILL inchecks-node-changed-compact-large-22(run 39007736518) did not repeat.openclaw/security-sensitive-reviewis the open approval gate below, not a test result.The Gateway-owner contract decision below and the maintainer security approval remain open; this update claims neither approval nor landing readiness with green CI.
Historical author-reported evidence
The evidence below belongs to the named earlier heads and has not been promoted to current-head proof.
Head
8606a2df718: six commits on the earlier head5d5ad44f5f6.6d62aefe5a1mergesmain@6b2afbfe981(the branch was CONFLICTING),32548a164bamoves the external-change audit appender out ofconfig-reload.ts,82be5c6edc6fixes the plugin lifecycle publication gap,759130f4cc7brings the health mocks inside main's mock-export ratchet,3ee3413ef5erechecks cached health after its awaited reads, and8606a2df718removes three mock-shaped tests.git merge-tree --write-treeagainstmain@f3f9bf90c69(2026-10-09) exits 0.Since then,
615fde1ef66mergesmain@bb642e181e1and56b8e57fe36mergesmain@4af30f64ca7. Neither changes an added or removed line of this branch's own diff; the merge notes below cover both.Plugin lifecycle publication (the P2 from the last review)
applyPluginLifecycleChangereads and applies the source outsiderunReload. It could consume a pending write and accept that write's watcher echo, and accepting the echo cleared the queued reload, so nothing published the source it applied. It now publishes through the same per-transaction tracker. Regression inconfig-reload.observation.test.ts, run on the same tree with and without the three production lines:Cached health after awaited reads (the P2 from the re-review)
The cached branch of the
healthRPC read the shared snapshot, awaited the delivery-queue and context-engine summaries, then answered from the captured copy even when a config observation had retired that snapshot in between. It now rereads the shared cache after the awaits and answers from a refresh when the snapshot is no longer the current one. Regression inhealth.runtime-config.test.ts, run with and without the production change:Tests and gates on
8606a2df718Run on an M4 Pro, Node 26, on the tree CI tests:
main@f3f9bf90c69merged with this head.config-reload,config-reload.observation,config-reload.plugin-drain,config-reload.lease-retry,server-reload-handlers,health-state,connect-hello.update-scope,connect-hello.setup-completion,server-connection-state,server-methods,health.owner-routing,health.runtime-config, the seven commands health suites, and the protocol snapshot schema): 601 passed, 0 failed.--baseat that main: max-lines, line-cap ("OK: 26 changed source files; no new violations or over-cap growth"), assertion-safety, database-worker, test-timeout-race and test-mock-exports ("Mock factory ratchet OK: 10238 grandfathered factories") pass, as doconfig:docs:checkandplugins:inventory:check.run-tsgo.mjs0 errors ontsconfig.core.jsonand the gateway-root, gateway-server, gateway-other, gateway-methods, commands and packages test shards.plugins:assets:check: generated assets match the committed bytes. Import cycles: 0 (measured at82be5c6edc6; no import changed since).check-changed, the other core test shards, fulllint:core, knip, and the docs MDX and link checks.Test cost. Wall is
pnpm test <file> --maxWorkers=1on the M4 Pro with the compiled-worker cache warm. CI is the sum of per-test times for that file in run 37976193929 (82be5c6edc6).src/gateway/config-reload.observation.test.ts(new)src/commands/health-runtime-config.test.ts(new)src/commands/health.snapshot.runtime-config.test.ts(new)src/gateway/server-methods/health.runtime-config.test.ts(new)src/gateway/server/health-state.test.tssrc/gateway/server/ws-connection/connect-hello.update-scope.test.tssrc/gateway/server-connection-state.test.tspackages/gateway-protocol/src/schema/snapshot.test.tsThe two rows with a test count in the CI column changed after that run: one case added, three removed. The observation suite runs on main's shared reload harness with fake timers and deferreds; it adds no real timers, sleeps or Gateway boot.
Process proof at
82be5c6edc6Isolated Gateway on an M4 Pro:
env -iwith a tempHOME,OPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATH,OPENCLAW_SKIP_CHANNELS=1, loopback port 28797, token auth,gateway.reload.mode: "off", started withpnpm openclaw gateway run --port 28797 --bind loopback --verbose. Clients:openclaw health --json(advertises the capability) andopenclaw gateway call health --json(does not).Neither the token nor the password appears in the 9,401 bytes of captured client output. The Gateway was stopped by the pids recorded at launch (
[shutdown] completed cleanly in 193ms).This run covers the
healthRPC for one advertising and one non-advertising client after the merge. The hello and event projections, the echo and reread races, and the plugin lifecycle case are covered by the regressions, not by this run. The earlier process run at59271bb6847also captured hello-ok with and without the capability (absent without it); that part was not repeated here. Not rerun at8606a2df718: the three later commits change tests and the cached branch of thehealthRPC, which the regression above covers.Observation publication (the two P2s from the review before that, measured at
59271bb6847)Each regression failed on the rebased pre-fix code and passed at
59271bb6847;config-reload.observation.test.tswent from 6 passed / 5 failed to 11/11:Not re-measured as before and after at this head. Main changed the contract under the four reread cases: a write notification now carries the writer's canonical reread, and the reloader no longer rereads. They are now three cases that drive the notification's snapshot (missing, invalid, replaced bytes) and pass. The read-failure case is deleted with the reread it covered. The echo case passes unchanged apart from building its write with
makeWrite.Regression with the pre-change strict v4 decoder
connect-hello.update-scope.test.tsbuilds the decoder a client had before this change (the current closedSnapshotSchemawithruntimeConfigremoved from the closed health object). On both the cached and uncached hello paths it accepts what a non-advertising client now receives, and that client's health has noruntimeConfig. An advertising client still getsruntimeConfig, which the current schema accepts and the pre-change decoder rejects.server-connection-state.test.tsandhealth.runtime-config.test.tspin the event and RPC projections.Pre-gate control, measured at
183d408dceewith the gate commit's six production files reverted andruntime-config-cap.tsremoved: 4 failed, 37 passed (the hello, broadcast, and cached and uncached RPC cases). With the gate, all four pass.Merge notes (
6d62aefe5a1)config-reload.ts: main moved source observation intosrc/config/source.ts(fix(config): apply Gateway writes without waiting for file events #157372), and a write notification now carries the writer's canonical reread (fix(config): settle Gateway writes after invalid canonical rereads #161868). The tracker keys onsource.observation.revision. Main's refactor(gateway): simplify session and reload bookkeeping #168980 removed the in-transaction echo catch-up, so the accepted-echo marker this PR had added is gone too. The echo's own reload pass publishes that read, one pass later; both echo regressions still observe the next generation. The pending-write path records the notification's snapshot because the reloader no longer rereads it.config-reload-watcher.tsis deleted: main dropped the polling resolver it held.server-connection-state.ts: main's per-recipient projection hook returns{ payload }, so the health projection returns that shape. This file merged without a textual conflict and failed typecheck until adapted.server-methods/health.ts: the capability projection wraps main's inlined cached-health object and its livechildRuntimeread.snapshot.ts:runtimeConfigsits beside main'schildRuntime.health.ts: the text line joins main's formatter loop.makeContextinconnect-hello.update-scope.test.tstakes{ caps, client }. The observation suite uses main'smakeWrite. The four pending-write "reread" cases became three that drive the notification's snapshot; the read-failure case is deleted with the reread it covered.config-reload.ts. The observation wiring adds nine counted lines and the resolver that used to pay for it is gone from main, so32548a164bamoves the external-change audit appender (it only reads the watched path) verbatim toconfig-reload-audit.ts.health.plugins.test.ts(56b8e57fe36,main@4af30f64ca7): main's sharedhealth.test-fixtures.jsimport sits beside this branch'sinstallHealthConfigMockimport.config/test-mock-exports-baseline.txtauto-merged; it is main's baseline minus this branch's three entries.CI on
82be5c6edc6(run 37976193929)Four jobs were red.
checks-fast-baseline-ratchets: this PR.check:test-mock-exportsrejected six mock factories the branch adds or changes. Fixed in759130f4cc7.checks-ui-e2e (7/8),chat-flow.history-recovery.e2e.test.ts("Timed out waiting for 1 chat.history requests"): red on main. The scheduled main runs at 18:38Z, 19:31Z and 20:33Z failed the same test at the same line, as did 21 other PR runs on 14 branches between 18:28Z and 20:39Z. This PR does not touchui/.checks-node-changed-5,gateway-node-exec-approvals.e2e.test.ts: the test passed and the job failed on an unhandled rejection ofnode returned invalid exec approvals payload. The test attaches.rejectsto that request two awaits after starting it (lines 168-181). Neither the test nor the exec-approvals path is in this diff. 3 of 3 local runs passed without the error.checks-node-changed-compact-large-14-1,src/gateway/server-reload-handlers.test.ts: 9 failed of 254, starting with three fake-timer cases that timed out at 120 s waiting on a write-triggered reload. Not reproduced: the same 18 files on the exact tree CI tested (164210c355emerged with82be5c6edc6) pass 254/254, the base alone passes 253/253, and the file passed 8 more times in a row on a later main merged with this branch, 4 of them under background QoS. The test file is not in this diff and did not fail in the 10 scheduled main runs or the 99 other failed PR runs I checked from that day. This branch changesconfig-reload.ts, which those cases drive, so I can't rule it out; I have no mechanism and no reproduction.openclaw/security-sensitive-reviewis the maintainer approval gate forconnect-hello.ts.Review metrics
main@4af30f64ca7: production +470/-76 in 14 files; tests and test support +1155/-21 in 12 files; docs +23/-3; the mock-export baseline -3. One optional, read-scoped health field behind one new client capability.Decision needed
For Gateway owners (CODEOWNERS has no entry for these paths): accept the additive, capability-gated
health.runtimeConfigfield, accept it with the gate on hello only, or close. With #89517 closed, this is the only place an operator sees reload-disabled or restart-pending drift.