From bf5541b4bf3a0d87eb4d10f682f8b88376d28043 Mon Sep 17 00:00:00 2001 From: "clawsweeper[bot]" <274271284+clawsweeper[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:07:02 -0700 Subject: [PATCH] fix: Found one low-severity compatibility regression in the diagnostic (#74560) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com> --- src/infra/diagnostics-timeline.test.ts | 6 ++++++ src/infra/diagnostics-timeline.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/infra/diagnostics-timeline.test.ts b/src/infra/diagnostics-timeline.test.ts index d391cdae2fa..4ad9f4f8577 100644 --- a/src/infra/diagnostics-timeline.test.ts +++ b/src/infra/diagnostics-timeline.test.ts @@ -45,6 +45,12 @@ describe("diagnostics timeline", () => { expect(isDiagnosticsTimelineEnabled({ env })).toBe(true); expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "1" } })).toBe(true); + expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "yes" } })).toBe( + true, + ); + expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "on" } })).toBe( + true, + ); expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "all" } })).toBe( true, ); diff --git a/src/infra/diagnostics-timeline.ts b/src/infra/diagnostics-timeline.ts index a7720085366..35602fa3d6d 100644 --- a/src/infra/diagnostics-timeline.ts +++ b/src/infra/diagnostics-timeline.ts @@ -4,6 +4,7 @@ import { dirname } from "node:path"; import { performance } from "node:perf_hooks"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { isDiagnosticFlagEnabled } from "./diagnostic-flags.js"; +import { isTruthyEnvValue } from "./env.js"; export const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1"; @@ -74,7 +75,8 @@ export function isDiagnosticsTimelineEnabled(options: DiagnosticsTimelineOptions const { config, env } = resolveDiagnosticsTimelineOptions(options); return ( (isDiagnosticFlagEnabled("timeline", config, env) || - isDiagnosticFlagEnabled("diagnostics.timeline", config, env)) && + isDiagnosticFlagEnabled("diagnostics.timeline", config, env) || + isTruthyEnvValue(env.OPENCLAW_DIAGNOSTICS)) && typeof env.OPENCLAW_DIAGNOSTICS_TIMELINE_PATH === "string" && env.OPENCLAW_DIAGNOSTICS_TIMELINE_PATH.trim().length > 0 );