diff --git a/CHANGELOG.md b/CHANGELOG.md index 94c9e671bdd..e7db9b7c5e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Docs: https://docs.openclaw.ai ### Fixes - Agents/edit tool: honor `file_path` and related path aliases when resolving edit-recovery targets, so post-write errors no longer surface false edit failures after the file actually changed. Fixes #81909. Thanks @giodl73-repo. +- QQBot: treat only explicit truthy `QQBOT_DEBUG` values as enabling debug logs, so false-like values such as `0` no longer expose debug output. Fixes #82644. (#82697) Thanks @leno23. - Gateway/diagnostics: add opt-in critical memory pressure stability snapshots with gateway logs, V8 heap, cgroup, active-resource, and redacted large session-file evidence. Fixes #82518. - Doctor/Gateway: avoid treating unrelated macOS LaunchAgents as legacy gateways just because their environment values mention old checkout paths. - CLI/setup: collapse raw gateway config keys in existing-config summaries into friendly `Model` and `Gateway` rows. diff --git a/extensions/qqbot/src/engine/utils/log.test.ts b/extensions/qqbot/src/engine/utils/log.test.ts index b12f076eea5..09444fb8cc1 100644 --- a/extensions/qqbot/src/engine/utils/log.test.ts +++ b/extensions/qqbot/src/engine/utils/log.test.ts @@ -25,4 +25,16 @@ describe("QQBot debug logging", () => { expect(logSpy).toHaveBeenCalledWith("prefix line one line two"); }); + + it.each(["0", "false", "off", "no"])( + "does not enable debug logging for QQBOT_DEBUG=%s", + (value) => { + process.env.QQBOT_DEBUG = value; + const logSpy = vi.spyOn(console, "log").mockImplementation(() => {}); + + debugLog("private message text"); + + expect(logSpy).not.toHaveBeenCalled(); + }, + ); }); diff --git a/extensions/qqbot/src/engine/utils/log.ts b/extensions/qqbot/src/engine/utils/log.ts index 7bb284df88a..711b2d7ea8b 100644 --- a/extensions/qqbot/src/engine/utils/log.ts +++ b/extensions/qqbot/src/engine/utils/log.ts @@ -8,7 +8,23 @@ * Self-contained within engine/ — no framework SDK dependency. */ -const isDebug = () => !!process.env.QQBOT_DEBUG; +function isQqbotDebugEnabled(): boolean { + const value = process.env.QQBOT_DEBUG; + if (typeof value !== "string") { + return false; + } + switch (value.trim().toLowerCase()) { + case "1": + case "on": + case "true": + case "yes": + return true; + default: + return false; + } +} + +const isDebug = () => isQqbotDebugEnabled(); const MAX_LOG_VALUE_CHARS = 4096; export function sanitizeDebugLogValue(value: unknown): string {