mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
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:
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user