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>
This commit is contained in:
clawsweeper[bot]
2026-04-29 14:07:02 -07:00
committed by GitHub
parent 6fb729a451
commit bf5541b4bf
2 changed files with 9 additions and 1 deletions

View File

@@ -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,
);

View File

@@ -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
);