openclaw/test/helpers/gateway
Peter Steinberger cd59fe831e
fix(config): settle writes after invalid canonical rereads (#161868)
When an external edit left openclaw.json missing or invalid while a
Gateway config write was waiting for runtime application, the final
canonical reread fell into the same branch that skips application. The
pending write then waited for another file event that never came, so
config.patch and config.apply hung until the client timed out.

The write snapshot is now checked through the reload contracts: a
missing or invalid reread fails the accepted transaction, and the
request returns UNAVAILABLE with the committed config details. The
runtime does not adopt the change, and the Gateway still never
overwrites the external edit. The hot-reload docs describe the
recovery: repair the file, run config.get, then reapply.

A deterministic regression injects an incomplete external edit mid-write
for config.set, config.patch and config.apply. It passed 42 executions
under stress-ng CPU load. The earlier CI "JSON5 parse failed" log line
came from an intentional corrupt-file fixture, not a torn write; disk
write atomicity is unchanged.

Release note: config.patch and config.apply no longer hang when the
config file is edited into an invalid state during a Gateway write; they
return UNAVAILABLE.
2026-09-30 05:52:03 -07:00
..
android-node-capabilities-policy-config.ts
android-node-capabilities-policy-source.ts
android-node-capabilities-required-commands.ts
config-rpc-gateway.ts fix(config): settle writes after invalid canonical rereads (#161868) 2026-09-30 05:52:03 -07:00