diff --git a/scripts/lib/local-heavy-check-runtime.mjs b/scripts/lib/local-heavy-check-runtime.mjs index c3697ba67e6..4b9a85bae80 100644 --- a/scripts/lib/local-heavy-check-runtime.mjs +++ b/scripts/lib/local-heavy-check-runtime.mjs @@ -92,6 +92,10 @@ export function shouldAcquireLocalHeavyCheckLockForOxlint( return true; } + if (args.some((arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-V")) { + return false; + } + const separatorIndex = args.indexOf("--"); const candidateArgs = (() => { if (separatorIndex !== -1) { diff --git a/test/scripts/local-heavy-check-runtime.test.ts b/test/scripts/local-heavy-check-runtime.test.ts index b1527328588..ffaa043cd64 100644 --- a/test/scripts/local-heavy-check-runtime.test.ts +++ b/test/scripts/local-heavy-check-runtime.test.ts @@ -251,6 +251,13 @@ describe("local-heavy-check-runtime", () => { ).toBe(false); }); + it("skips the heavy-check lock for oxlint metadata commands", () => { + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--help"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["-h"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["--version"])).toBe(false); + expect(shouldAcquireLocalHeavyCheckLockForOxlint(["-V"])).toBe(false); + }); + it("keeps the heavy-check lock for directory targets and broad oxlint runs", () => { const cwd = createTempDir("openclaw-oxlint-lock-keep-"); fs.mkdirSync(path.join(cwd, "src"), { recursive: true });