diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c7dd6524..e43f5a355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai - Agents/Ollama: preserve unsafe integer tool-call arguments as exact strings during NDJSON parsing, preventing large numeric IDs from being rounded before tool execution. (#23170) Thanks @BestJoester. - Cron/Gateway: keep `cron.list` and `cron.status` responsive during startup catch-up by avoiding a long-held cron lock while missed jobs execute. (#23106) Thanks @jayleekr. +- Gateway/Config reload: compare array-valued config paths structurally during diffing so unchanged `memory.qmd.paths` and `memory.qmd.scope.rules` no longer trigger false restart-required reloads. (#23185) Thanks @rex05ai. - Gateway/Pairing: treat operator.admin pairing tokens as satisfying operator.write requests so legacy devices stop looping through scope-upgrade prompts introduced in 2026.2.19. (#23125, #23006) Thanks @vignesh07. - Memory/QMD: add optional `memory.qmd.mcporter` search routing so QMD `query/search/vsearch` can run through mcporter keep-alive flows (including multi-collection paths) to reduce cold starts, while keeping searches on agent-scoped QMD state for consistent recall. (#19617) Thanks @nicole-luxe and @vignesh07. - Chat/UI: strip inline reply/audio directive tags (`[[reply_to_current]]`, `[[reply_to:]]`, `[[audio_as_voice]]`) from displayed chat history, live chat event output, and session preview snippets so control tags no longer leak into user-visible surfaces. diff --git a/src/gateway/config-reload.test.ts b/src/gateway/config-reload.test.ts index 3ad545855..d81c4cf7d 100644 --- a/src/gateway/config-reload.test.ts +++ b/src/gateway/config-reload.test.ts @@ -23,6 +23,48 @@ describe("diffConfigPaths", () => { const paths = diffConfigPaths(prev, next); expect(paths).toContain("messages.groupChat.mentionPatterns"); }); + + it("does not report unchanged arrays of objects as changed", () => { + const prev = { + memory: { + qmd: { + paths: [{ path: "~/docs", pattern: "**/*.md", name: "docs" }], + scope: { + rules: [{ when: { channel: "slack" }, include: ["docs"] }], + }, + }, + }, + }; + const next = { + memory: { + qmd: { + paths: [{ path: "~/docs", pattern: "**/*.md", name: "docs" }], + scope: { + rules: [{ when: { channel: "slack" }, include: ["docs"] }], + }, + }, + }, + }; + expect(diffConfigPaths(prev, next)).toEqual([]); + }); + + it("reports changed arrays of objects", () => { + const prev = { + memory: { + qmd: { + paths: [{ path: "~/docs", pattern: "**/*.md", name: "docs" }], + }, + }, + }; + const next = { + memory: { + qmd: { + paths: [{ path: "~/docs", pattern: "**/*.txt", name: "docs" }], + }, + }, + }; + expect(diffConfigPaths(prev, next)).toContain("memory.qmd.paths"); + }); }); describe("buildGatewayReloadPlan", () => { diff --git a/src/gateway/config-reload.ts b/src/gateway/config-reload.ts index a9b0de69e..9be7f458a 100644 --- a/src/gateway/config-reload.ts +++ b/src/gateway/config-reload.ts @@ -1,3 +1,4 @@ +import { isDeepStrictEqual } from "node:util"; import chokidar from "chokidar"; import { type ChannelId, listChannelPlugins } from "../channels/plugins/index.js"; import type { OpenClawConfig, ConfigFileSnapshot, GatewayReloadMode } from "../config/config.js"; @@ -150,7 +151,9 @@ export function diffConfigPaths(prev: unknown, next: unknown, prefix = ""): stri return paths; } if (Array.isArray(prev) && Array.isArray(next)) { - if (prev.length === next.length && prev.every((val, idx) => val === next[idx])) { + // Arrays can contain object entries (for example memory.qmd.paths/scope.rules); + // compare structurally so identical values are not reported as changed. + if (isDeepStrictEqual(prev, next)) { return []; } }