diff --git a/scripts/gateway-watch-tmux.mjs b/scripts/gateway-watch-tmux.mjs index 21fe0a3f024..b9de833975b 100644 --- a/scripts/gateway-watch-tmux.mjs +++ b/scripts/gateway-watch-tmux.mjs @@ -239,7 +239,7 @@ export const runGatewayWatchTmuxMain = (params = {}) => { log(deps.stderr, `gateway:watch benchmark CPU profiles: ${resolvedArgs.benchmarkProfileDir}`); } - if (TMUX_DISABLE_VALUES.has(String(deps.env.OPENCLAW_GATEWAY_WATCH_TMUX ?? "").toLowerCase())) { + if (TMUX_DISABLE_VALUES.has((deps.env.OPENCLAW_GATEWAY_WATCH_TMUX ?? "").toLowerCase())) { return runForegroundWatcher({ args: deps.args, cwd: deps.cwd, diff --git a/src/plugins/source-checkout-runtime.test.ts b/src/plugins/source-checkout-runtime.test.ts index ee1882143dc..2d8f5265f94 100644 --- a/src/plugins/source-checkout-runtime.test.ts +++ b/src/plugins/source-checkout-runtime.test.ts @@ -1,9 +1,10 @@ +import fs from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { loadOpenClawPlugins } from "./loader.js"; describe("source checkout bundled plugin runtime", () => { - it("loads enabled bundled plugins from built dist when available", () => { + it("loads enabled bundled plugins from built dist or source checkout", () => { const registry = loadOpenClawPlugins({ cache: false, onlyPluginIds: ["twitch"], @@ -21,9 +22,16 @@ describe("source checkout bundled plugin runtime", () => { status: "loaded", origin: "bundled", }); - expect(twitch?.source).toContain( - `${path.sep}dist${path.sep}extensions${path.sep}twitch${path.sep}index.js`, - ); - expect(twitch?.rootDir).toContain(`${path.sep}dist${path.sep}extensions${path.sep}twitch`); + + const builtRuntime = path.join(process.cwd(), "dist", "extensions", "twitch", "index.js"); + const expectedRuntime = fs.existsSync(builtRuntime) + ? `${path.sep}dist${path.sep}extensions${path.sep}twitch${path.sep}index.js` + : `${path.sep}extensions${path.sep}twitch${path.sep}index.ts`; + const expectedRoot = fs.existsSync(builtRuntime) + ? `${path.sep}dist${path.sep}extensions${path.sep}twitch` + : `${path.sep}extensions${path.sep}twitch`; + + expect(twitch?.source).toContain(expectedRuntime); + expect(twitch?.rootDir).toContain(expectedRoot); }); });