Skip to content

Commit bf5541b

Browse files
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>
1 parent 6fb729a commit bf5541b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/infra/diagnostics-timeline.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ describe("diagnostics timeline", () => {
4545

4646
expect(isDiagnosticsTimelineEnabled({ env })).toBe(true);
4747
expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "1" } })).toBe(true);
48+
expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "yes" } })).toBe(
49+
true,
50+
);
51+
expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "on" } })).toBe(
52+
true,
53+
);
4854
expect(isDiagnosticsTimelineEnabled({ env: { ...env, OPENCLAW_DIAGNOSTICS: "all" } })).toBe(
4955
true,
5056
);

src/infra/diagnostics-timeline.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { dirname } from "node:path";
44
import { performance } from "node:perf_hooks";
55
import type { OpenClawConfig } from "../config/types.openclaw.js";
66
import { isDiagnosticFlagEnabled } from "./diagnostic-flags.js";
7+
import { isTruthyEnvValue } from "./env.js";
78

89
export const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1";
910

@@ -74,7 +75,8 @@ export function isDiagnosticsTimelineEnabled(options: DiagnosticsTimelineOptions
7475
const { config, env } = resolveDiagnosticsTimelineOptions(options);
7576
return (
7677
(isDiagnosticFlagEnabled("timeline", config, env) ||
77-
isDiagnosticFlagEnabled("diagnostics.timeline", config, env)) &&
78+
isDiagnosticFlagEnabled("diagnostics.timeline", config, env) ||
79+
isTruthyEnvValue(env.OPENCLAW_DIAGNOSTICS)) &&
7880
typeof env.OPENCLAW_DIAGNOSTICS_TIMELINE_PATH === "string" &&
7981
env.OPENCLAW_DIAGNOSTICS_TIMELINE_PATH.trim().length > 0
8082
);

0 commit comments

Comments
 (0)