openclaw/src/gateway
lbo728 aaa9bd0f1c fix(config-reload): skip reload when config file is not found
When a config file is written atomically (tmp → rename), chokidar can
fire an 'unlink' event for the temporary removal of the destination file
before the rename completes. runReload() would then call readSnapshot(),
which returns { exists: false, valid: true, config: {} } — an empty
config that looks valid — causing diffConfigPaths() to find many changes
and triggering an unnecessary SIGUSR1 restart.

The restarted gateway process then fails to find the config file (still
in the middle of the write) and enters a crash loop with:
  'Missing config. Run openclaw setup...'

Fix: guard against exists=false before the existing valid=false check,
so mid-write snapshots are silently skipped rather than treated as a
config wipe.

Fixes #23321
2026-02-22 15:34:46 +01:00
..
protocol refactor(runtime): consolidate followup, gateway, and provider dedupe paths 2026-02-22 14:08:51 +00:00
server refactor(runtime): consolidate followup, gateway, and provider dedupe paths 2026-02-22 14:08:51 +00:00
server-methods chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
agent-event-assistant-text.ts refactor(gateway): dedupe assistant delta parsing 2026-02-15 19:08:47 +00:00
agent-prompt.test.ts test: move gateway rpc/local suites out of e2e 2026-02-22 11:31:42 +00:00
agent-prompt.ts refactor(gateway): share agent prompt builder 2026-02-14 15:39:45 +00:00
assistant-identity.test.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
assistant-identity.ts fix(security): harden avatar validation and size limits 2026-02-22 08:35:32 +01:00
auth-rate-limit.test.ts fix(security): normalize hook auth rate-limit client keys 2026-02-22 08:40:49 +01:00
auth-rate-limit.ts refactor(security): unify hook rate-limit and hook module loading 2026-02-22 08:57:01 +01:00
auth.test.ts refactor(core): dedupe gateway runtime and config tests 2026-02-22 07:44:57 +00:00
auth.ts refactor(gateway): harden proxy client ip resolution 2026-02-21 13:36:23 +01:00
boot.test.ts test(gateway): dedupe boot workspace setup and cover boot failures 2026-02-21 21:40:38 +00:00
boot.ts fix: run BOOT.md for each configured agent at startup (#20569) 2026-02-19 00:58:56 -05:00
call.test.ts Gateway UX: harden remote ws guidance and onboarding defaults 2026-02-22 12:46:20 +01:00
call.ts Gateway UX: harden remote ws guidance and onboarding defaults 2026-02-22 12:46:20 +01:00
canvas-capability.ts fix(gateway): harden canvas auth with session capabilities 2026-02-19 15:51:22 +01:00
channel-health-monitor.test.ts perf(test): reduce channel health monitor check slack 2026-02-18 22:39:57 +00:00
channel-health-monitor.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
chat-abort.test.ts Gateway/Control UI: preserve partial output on abort (#15026) 2026-02-15 16:55:28 -08:00
chat-abort.ts Gateway/Control UI: preserve partial output on abort (#15026) 2026-02-15 16:55:28 -08:00
chat-attachments.test.ts test(gateway): extract shared parse warning helper 2026-02-21 23:32:32 +00:00
chat-attachments.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
chat-sanitize.test.ts fix: hide synthetic untrusted metadata in chat history 2026-02-21 19:26:04 +01:00
chat-sanitize.ts fix: hide synthetic untrusted metadata in chat history 2026-02-21 19:26:04 +01:00
client.test.ts Gateway UX: harden remote ws guidance and onboarding defaults 2026-02-22 12:46:20 +01:00
client.ts Gateway UX: harden remote ws guidance and onboarding defaults 2026-02-22 12:46:20 +01:00
client.watchdog.test.ts test: move gateway client watchdog suite out of e2e 2026-02-22 11:34:50 +00:00
config-reload.test.ts Gateway: deep-compare array config paths for reload diff 2026-02-21 19:17:46 -08:00
config-reload.ts fix(config-reload): skip reload when config file is not found 2026-02-22 15:34:46 +01:00
control-plane-audit.ts fix: harden gateway control-plane restart protections 2026-02-19 14:30:15 +01:00
control-plane-rate-limit.ts fix(security): harden gateway command/audit guardrails 2026-02-22 08:45:48 +01:00
control-ui-contract.ts refactor(gateway): share Control UI bootstrap contract and CSP 2026-02-16 03:50:39 +01:00
control-ui-csp.test.ts refactor(gateway): share Control UI bootstrap contract and CSP 2026-02-16 03:50:39 +01:00
control-ui-csp.ts refactor(gateway): share Control UI bootstrap contract and CSP 2026-02-16 03:50:39 +01:00
control-ui-shared.ts fix(security): harden avatar validation and size limits 2026-02-22 08:35:32 +01:00
control-ui.http.test.ts test(gateway): dedupe control-ui not-found fixture assertions 2026-02-22 07:44:57 +00:00
control-ui.ts Security/Gateway: harden Control UI static path containment (#21203) 2026-02-21 23:47:51 +01:00
device-auth.ts refactor(gateway)!: remove legacy v1 device-auth handshake 2026-02-22 09:27:03 +01:00
events.ts refactor: unify restart gating and update availability sync 2026-02-19 10:00:41 +01:00
exec-approval-manager.ts fix(gateway): bind system.run approvals to exec approvals 2026-02-14 13:27:45 +01:00
gateway-cli-backend.live.test.ts test(gateway): dedupe agent payload and stream fixtures 2026-02-19 09:22:16 +00:00
gateway-config-prompts.shared.ts refactor(gateway): share tailscale prompt constants 2026-02-15 18:06:48 +00:00
gateway-misc.test.ts test(gateway): dedupe control-ui fixture setup and cover query asset 404 2026-02-21 21:40:39 +00:00
gateway-models.profiles.live.test.ts test(gateway): dedupe agent payload and stream fixtures 2026-02-19 09:22:16 +00:00
gateway.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
hooks-mapping.test.ts fix(security): block hook transform symlink escapes 2026-02-22 10:18:05 +01:00
hooks-mapping.ts fix(security): block hook transform symlink escapes 2026-02-22 10:18:05 +01:00
hooks.test.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
hooks.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
http-auth-helpers.test.ts refactor(gateway): make ws and http auth surfaces explicit 2026-02-21 13:33:09 +01:00
http-auth-helpers.ts refactor(gateway): harden proxy client ip resolution 2026-02-21 13:36:23 +01:00
http-common.ts security: add baseline security headers to gateway HTTP responses (#10526) 2026-02-19 03:28:24 -08:00
http-endpoint-helpers.test.ts refactor(gateway): dedupe json endpoint prelude 2026-02-15 13:24:37 +00:00
http-endpoint-helpers.ts refactor(gateway): harden proxy client ip resolution 2026-02-21 13:36:23 +01:00
http-utils.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
live-image-probe.ts refactor: consolidate PNG encoder and safeParseJson utilities (#12457) 2026-02-09 00:21:54 -08:00
method-scopes.test.ts fix(security): centralize owner-only tool gating and scope maps 2026-02-19 15:29:23 +01:00
method-scopes.ts fix: add operator.read and operator.write to default CLI scopes (#22582) 2026-02-22 16:36:18 +05:30
net.test.ts test: optimize gateway infra memory and security coverage 2026-02-21 21:44:50 +00:00
net.ts refactor(gateway): harden proxy client ip resolution 2026-02-21 13:36:23 +01:00
node-command-policy.ts fix(gateway): block node.invoke exec approvals 2026-02-14 19:22:37 +01:00
node-invoke-sanitize.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
node-invoke-system-run-approval.test.ts fix(security): harden and refactor system.run command resolution 2026-02-21 11:49:38 +01:00
node-invoke-system-run-approval.ts fix(security): harden and refactor system.run command resolution 2026-02-21 11:49:38 +01:00
node-registry.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
open-responses.schema.ts
openai-http.test.ts chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
openai-http.ts fix(gateway): tighten openai-http edge handling 2026-02-22 11:29:31 +00:00
openresponses-http.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
openresponses-http.ts refactor(gateway): harden proxy client ip resolution 2026-02-21 13:36:23 +01:00
openresponses-parity.test.ts test: reclassify openresponses parity suite 2026-02-22 11:34:15 +00:00
origin-check.test.ts fix: harden control ui framing + ws origin 2026-02-03 16:00:57 -08:00
origin-check.ts refactor(gateway): share host header parsing 2026-02-15 16:15:53 +00:00
probe-auth.ts refactor(gateway): dedupe probe auth resolution 2026-02-15 06:40:04 +00:00
probe.test.ts Gateway: align pairing scope checks for read access 2026-02-20 05:12:05 +00:00
probe.ts Gateway: align pairing scope checks for read access 2026-02-20 05:12:05 +00:00
role-policy.test.ts refactor(gateway): extract connect and role policy logic 2026-02-21 19:47:22 +01:00
role-policy.ts refactor(gateway): extract connect and role policy logic 2026-02-21 19:47:22 +01:00
server-broadcast.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-browser.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-channels.test.ts perf(test): tighten fake timer windows in channel restart tests 2026-02-18 22:11:56 +00:00
server-channels.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-chat.agent-events.test.ts fix(gateway): strip inline directive tags from displayed text 2026-02-21 20:08:55 +01:00
server-chat.ts fix(gateway): strip inline directive tags from displayed text 2026-02-21 20:08:55 +01:00
server-close.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-constants.ts fix(canvas): port remaining iOS branch stability fixes (#18228) 2026-02-16 16:42:28 +00:00
server-cron.test.ts test(gateway): use lightweight clears in cron service setup 2026-02-22 08:01:15 +00:00
server-cron.ts fix(stability): patch regex retries and timeout abort handling 2026-02-22 10:59:34 +01:00
server-discovery-runtime.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
server-discovery.test.ts test(core): continue mock reset reductions in auth, gateway, npm install 2026-02-22 08:28:50 +00:00
server-discovery.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-http.hooks-request-timeout.test.ts test(core): trim reset usage in gateway and install source specs 2026-02-22 08:25:09 +00:00
server-http.ts refactor(security): unify hook rate-limit and hook module loading 2026-02-22 08:57:01 +01:00
server-lanes.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-maintenance.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-methods-list.ts refactor: unify restart gating and update availability sync 2026-02-19 10:00:41 +01:00
server-methods.control-plane-rate-limit.test.ts fix(security): harden gateway command/audit guardrails 2026-02-22 08:45:48 +01:00
server-methods.ts refactor(gateway): extract connect and role policy logic 2026-02-21 19:47:22 +01:00
server-mobile-nodes.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-model-catalog.ts
server-node-events-types.ts
server-node-events.test.ts chore(gateway): cover denied notifyOnExit path and clarify help 2026-02-22 13:14:08 +01:00
server-node-events.ts fix(node): respect tools.exec.notifyOnExit for node exec events 2026-02-22 13:14:07 +01:00
server-node-subscriptions.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-plugins.test.ts chore: Fix types in tests 38/N. 2026-02-17 15:50:07 +09:00
server-plugins.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-reload-handlers.ts refactor: unify restart gating and update availability sync 2026-02-19 10:00:41 +01:00
server-restart-deferral.test.ts perf(test): cut gateway unit suite overhead 2026-02-16 00:18:26 +00:00
server-restart-sentinel.ts fix(types): align restart sentinel and typing test mocks 2026-02-18 18:25:25 +00:00
server-runtime-config.test.ts test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present 2026-02-22 15:17:37 +01:00
server-runtime-config.ts fix(gateway): require loopback proxy IP for trusted-proxy + bind=loopback (#22082) 2026-02-20 18:03:53 +00:00
server-runtime-state.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server-session-key.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-shared.ts
server-startup-log.test.ts fix(gateway): unify listen startup log across bind hosts 2026-02-22 13:17:25 +01:00
server-startup-log.ts fix(gateway): unify listen startup log across bind hosts 2026-02-22 13:17:25 +01:00
server-startup-memory.test.ts test(core): trim reset usage in gateway and install source specs 2026-02-22 08:25:09 +00:00
server-startup-memory.ts Memory/QMD: harden multi-collection search and embed scheduling 2026-02-20 19:41:51 -08:00
server-startup.ts refactor(gateway): share gmail watcher startup flow 2026-02-18 17:48:02 +00:00
server-tailscale.ts
server-utils.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-wizard-sessions.ts chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
server-ws-runtime.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
server.agent.gateway-server-agent-a.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.agent.gateway-server-agent-b.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.agent.gateway-server-agent.mocks.ts fix(test): complete gateway plugin registry mock 2026-02-14 23:51:41 +00:00
server.auth.test.ts chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
server.canvas-auth.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.channels.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.chat.gateway-server-chat-b.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.chat.gateway-server-chat.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.config-apply.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.config-patch.test.ts test: move gateway rpc/local suites out of e2e 2026-02-22 11:31:42 +00:00
server.cron.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.e2e-registry-helpers.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
server.e2e-ws-harness.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.health.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.hooks.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.impl.ts refactor: unify restart gating and update availability sync 2026-02-19 10:00:41 +01:00
server.ios-client-id.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.models-voicewake-misc.test.ts chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
server.node-invoke-approval-bypass.test.ts test: close bootstrap ws in approval bypass suite 2026-02-22 12:55:22 +00:00
server.plugin-http-auth.test.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
server.reload.test.ts test: move gateway rpc/local suites out of e2e 2026-02-22 11:31:42 +00:00
server.roles-allowlist-update.test.ts test: move gateway server integration suites out of e2e 2026-02-22 11:33:27 +00:00
server.sessions-send.test.ts test: move sessions_send suite out of e2e 2026-02-22 11:50:22 +00:00
server.sessions.gateway-server-sessions-a.test.ts test: reclassify gateway local suites from e2e 2026-02-22 11:48:46 +00:00
server.skills-status.test.ts test: move gateway rpc/local suites out of e2e 2026-02-22 11:31:42 +00:00
server.talk-config.test.ts test: move gateway rpc/local suites out of e2e 2026-02-22 11:31:42 +00:00
server.ts
session-preview.test-helpers.ts refactor(gateway-test): share preview transcript fixture 2026-02-18 17:01:22 +00:00
session-utils.fs.test.ts test(gateway): dedupe transcript seed fixtures in fs session tests 2026-02-22 07:44:57 +00:00
session-utils.fs.ts fix(gateway): strip inline directive tags from displayed text 2026-02-21 20:08:55 +01:00
session-utils.test.ts fix(gateway): block avatar symlink escapes 2026-02-22 08:51:17 +01:00
session-utils.ts fix(gateway): guard trim crashes in subagent flow 2026-02-22 13:21:26 +01:00
session-utils.types.ts fix: /status shows incorrect context percentage — totalTokens clamped to contextTokens (#15114) (#15133) 2026-02-12 23:52:19 -05:00
sessions-patch.test.ts test: dedupe gateway auth and sessions patch coverage 2026-02-18 05:30:59 +00:00
sessions-patch.ts fix(cli): display correct model for sub-agents in sessions list (#18660) 2026-02-17 23:59:20 -05:00
sessions-resolve.ts fix(gateway): normalize session key casing to prevent ghost sessions (#12846) 2026-02-13 20:42:24 +01:00
startup-auth.test.ts test(core): trim redundant test resets and use mockClear 2026-02-22 08:12:55 +00:00
startup-auth.ts fix: enforce hooks token separation from gateway auth (#20813) 2026-02-19 02:48:08 -08:00
test-helpers.agent-results.ts test(gateway): dedupe agent payload and stream fixtures 2026-02-19 09:22:16 +00:00
test-helpers.e2e.ts refactor(gateway)!: remove legacy v1 device-auth handshake 2026-02-22 09:27:03 +01:00
test-helpers.mocks.ts fix: remove hardcoded disableBlockStreaming to honor agent config for TUI (#19693) 2026-02-18 16:25:59 -05:00
test-helpers.openai-mock.ts test(gateway): reuse shared openai timeout e2e helpers 2026-02-22 07:44:57 +00:00
test-helpers.server.ts test: make gateway connectReq timeout configurable 2026-02-22 12:18:21 +00:00
test-helpers.ts
test-http-response.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
test-openai-responses-model.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
test-temp-config.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
test-with-server.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
tools-invoke-http.test.ts refactor(core): dedupe gateway runtime and config tests 2026-02-22 07:44:57 +00:00
tools-invoke-http.ts fix(security): centralize WhatsApp outbound auth and return 403 tool auth errors 2026-02-21 14:31:01 +01:00
ws-log.test.ts
ws-log.ts refactor(channels): dedupe transport and gateway test scaffolds 2026-02-16 14:59:31 +00:00
ws-logging.ts