diff --git a/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-d.test.ts b/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-d.test.ts index 03e47be2589..4ae403b902d 100644 --- a/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-d.test.ts +++ b/src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-d.test.ts @@ -57,10 +57,10 @@ describe("createOpenClawCodingTools", () => { } }); it("filters tools by sandbox policy", () => { - const sandboxDir = path.join(os.tmpdir(), "moltbot-sandbox"); + const sandboxDir = path.join(os.tmpdir(), "openclaw-sandbox"); const sandbox = createPiToolsSandboxContext({ workspaceDir: sandboxDir, - agentWorkspaceDir: path.join(os.tmpdir(), "moltbot-workspace"), + agentWorkspaceDir: path.join(os.tmpdir(), "openclaw-workspace"), workspaceAccess: "none" as const, fsBridge: createHostSandboxFsBridge(sandboxDir), tools: { @@ -74,10 +74,10 @@ describe("createOpenClawCodingTools", () => { expect(tools.some((tool) => tool.name === "browser")).toBe(false); }); it("hard-disables write/edit when sandbox workspaceAccess is ro", () => { - const sandboxDir = path.join(os.tmpdir(), "moltbot-sandbox"); + const sandboxDir = path.join(os.tmpdir(), "openclaw-sandbox"); const sandbox = createPiToolsSandboxContext({ workspaceDir: sandboxDir, - agentWorkspaceDir: path.join(os.tmpdir(), "moltbot-workspace"), + agentWorkspaceDir: path.join(os.tmpdir(), "openclaw-workspace"), workspaceAccess: "ro" as const, fsBridge: createHostSandboxFsBridge(sandboxDir), tools: { diff --git a/src/agents/sandbox/fs-bridge-mutation-helper.test.ts b/src/agents/sandbox/fs-bridge-mutation-helper.test.ts index 973c81341d1..bda85e08069 100644 --- a/src/agents/sandbox/fs-bridge-mutation-helper.test.ts +++ b/src/agents/sandbox/fs-bridge-mutation-helper.test.ts @@ -38,7 +38,7 @@ function runWritePlan(args: string[], input?: string) { mkdir: args[4] === "1", }); - return spawnSync("sh", ["-c", plan.script, "moltbot-sandbox-fs", ...(plan.args ?? [])], { + return spawnSync("sh", ["-c", plan.script, "openclaw-sandbox-fs", ...(plan.args ?? [])], { input, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], diff --git a/src/agents/sandbox/fs-bridge.test-helpers.ts b/src/agents/sandbox/fs-bridge.test-helpers.ts index 2d1c5092fc6..5cd987b06a7 100644 --- a/src/agents/sandbox/fs-bridge.test-helpers.ts +++ b/src/agents/sandbox/fs-bridge.test-helpers.ts @@ -103,12 +103,12 @@ export function dockerExecResult(stdout: string) { export function createSandbox(overrides?: Partial): SandboxContext { return createSandboxTestContext({ overrides: { - containerName: "moltbot-sbx-test", + containerName: "openclaw-sbx-test", ...overrides, }, dockerOverrides: { - image: "moltbot-sandbox:bookworm-slim", - containerPrefix: "moltbot-sbx-", + image: "openclaw-sandbox:bookworm-slim", + containerPrefix: "openclaw-sbx-", }, }); } diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index 52c5128e625..7b5feff8581 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -272,7 +272,7 @@ describe("buildAgentSystemPrompt", () => { }); expect(prompt).toContain( - 'For requests like "do this in codex/claude code/gemini", treat it as ACP harness intent', + 'For requests like "do this in codex/claude code/cursor/gemini" or similar ACP harnesses, treat it as ACP harness intent', ); expect(prompt).toContain( 'On Discord, default ACP harness requests to thread-bound persistent sessions (`thread: true`, `mode: "session"`)', @@ -414,10 +414,7 @@ describe("buildAgentSystemPrompt", () => { // The system prompt intentionally does NOT include the current date/time. // Only the timezone is included, to keep the prompt stable for caching. - // See: https://github.com/moltbot/moltbot/commit/66eec295b894bce8333886cfbca3b960c57c4946 // Agents should use session_status or message timestamps to determine the date/time. - // Related: https://github.com/moltbot/moltbot/issues/1897 - // https://github.com/moltbot/moltbot/issues/3658 it("does NOT include a date or time in the system prompt (cache stability)", () => { const prompt = buildAgentSystemPrompt({ workspaceDir: "/tmp/clawd", @@ -427,10 +424,9 @@ describe("buildAgentSystemPrompt", () => { }); // The prompt should contain the timezone but NOT the formatted date/time string. - // This is intentional for prompt cache stability — the date/time was removed in - // commit 66eec295b. If you're here because you want to add it back, please see - // https://github.com/moltbot/moltbot/issues/3658 for the preferred approach: - // gateway-level timestamp injection into messages, not the system prompt. + // This is intentional for prompt cache stability. If you want to add date/time + // awareness, do it through gateway-level timestamp injection into messages, not + // the system prompt. expect(prompt).toContain("Time zone: America/Chicago"); expect(prompt).not.toContain("Monday, January 5th, 2026"); expect(prompt).not.toContain("3:26 PM"); diff --git a/src/agents/test-helpers/fast-tool-stubs.ts b/src/agents/test-helpers/fast-tool-stubs.ts index da29363b50f..7a9c9eb9ec5 100644 --- a/src/agents/test-helpers/fast-tool-stubs.ts +++ b/src/agents/test-helpers/fast-tool-stubs.ts @@ -27,4 +27,5 @@ vi.mock("../tools/web-tools.js", () => ({ vi.mock("../../plugins/tools.js", () => ({ resolvePluginTools: () => [], getPluginToolMeta: () => undefined, + copyPluginToolMeta: (_source: unknown, target: unknown) => target, })); diff --git a/src/commands/doctor-gateway-services.test.ts b/src/commands/doctor-gateway-services.test.ts index 24e376568d2..9da95453d9f 100644 --- a/src/commands/doctor-gateway-services.test.ts +++ b/src/commands/doctor-gateway-services.test.ts @@ -44,9 +44,13 @@ vi.mock("../config/paths.js", () => ({ resolveIsNixMode: mocks.resolveIsNixMode, })); -vi.mock("../config/config.js", () => ({ - writeConfigFile: mocks.writeConfigFile, -})); +vi.mock("../config/config.js", async () => { + const actual = await vi.importActual("../config/config.js"); + return { + ...actual, + writeConfigFile: mocks.writeConfigFile, + }; +}); vi.mock("../daemon/inspect.js", () => ({ findExtraGatewayServices: mocks.findExtraGatewayServices, @@ -603,16 +607,16 @@ describe("maybeScanExtraGatewayServices", () => { mocks.findExtraGatewayServices.mockResolvedValue([ { platform: "linux", - label: "moltbot-gateway.service", - detail: "unit: /home/test/.config/systemd/user/moltbot-gateway.service", + label: "clawdbot-gateway.service", + detail: "unit: /home/test/.config/systemd/user/clawdbot-gateway.service", scope: "user", legacy: true, }, ]); mocks.uninstallLegacySystemdUnits.mockResolvedValue([ { - name: "moltbot-gateway", - unitPath: "/home/test/.config/systemd/user/moltbot-gateway.service", + name: "clawdbot-gateway", + unitPath: "/home/test/.config/systemd/user/clawdbot-gateway.service", enabled: true, exists: true, }, @@ -644,7 +648,7 @@ describe("maybeScanExtraGatewayServices", () => { stdout: process.stdout, }); expect(mocks.note).toHaveBeenCalledWith( - expect.stringContaining("moltbot-gateway.service"), + expect.stringContaining("clawdbot-gateway.service"), "Legacy gateway removed", ); expect(runtime.log).toHaveBeenCalledWith( diff --git a/src/config/paths.test.ts b/src/config/paths.test.ts index 4702af0d2ed..df8e7cd35a4 100644 --- a/src/config/paths.test.ts +++ b/src/config/paths.test.ts @@ -144,13 +144,8 @@ describe("state + config path candidates", () => { const expected = [ path.join(resolvedHome, ".openclaw", "openclaw.json"), path.join(resolvedHome, ".openclaw", "clawdbot.json"), - path.join(resolvedHome, ".openclaw", "moldbot.json"), path.join(resolvedHome, ".clawdbot", "openclaw.json"), path.join(resolvedHome, ".clawdbot", "clawdbot.json"), - path.join(resolvedHome, ".clawdbot", "moldbot.json"), - path.join(resolvedHome, ".moldbot", "openclaw.json"), - path.join(resolvedHome, ".moldbot", "clawdbot.json"), - path.join(resolvedHome, ".moldbot", "moldbot.json"), ]; expect(candidates).toEqual(expected); }); diff --git a/src/daemon/constants.test.ts b/src/daemon/constants.test.ts index f8329c519e8..92680e854da 100644 --- a/src/daemon/constants.test.ts +++ b/src/daemon/constants.test.ts @@ -133,6 +133,5 @@ describe("resolveGatewayServiceDescription", () => { describe("LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES", () => { it("includes known pre-rebrand gateway unit names", () => { expect(LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES).toContain("clawdbot-gateway"); - expect(LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES).toContain("moltbot-gateway"); }); }); diff --git a/src/daemon/inspect.test.ts b/src/daemon/inspect.test.ts index e65acdad2fb..5a215b7e2eb 100644 --- a/src/daemon/inspect.test.ts +++ b/src/daemon/inspect.test.ts @@ -185,9 +185,6 @@ describe("findExtraGatewayServices (win32)", () => { "TaskName: Other Task", "Task To Run: C:\\tools\\helper.exe", "", - "TaskName: MoltBot Legacy", - "Task To Run: C:\\moltbot\\moltbot.exe run", - "", ].join("\n"), stderr: "", }); @@ -202,14 +199,6 @@ describe("findExtraGatewayServices (win32)", () => { marker: "clawdbot", legacy: true, }, - { - platform: "win32", - label: "MoltBot Legacy", - detail: "task: MoltBot Legacy, run: C:\\moltbot\\moltbot.exe run", - scope: "system", - marker: "moltbot", - legacy: true, - }, ]); }); }); diff --git a/src/infra/state-migrations.state-dir.test.ts b/src/infra/state-migrations.state-dir.test.ts index c6bf9085424..100835e8619 100644 --- a/src/infra/state-migrations.state-dir.test.ts +++ b/src/infra/state-migrations.state-dir.test.ts @@ -25,10 +25,10 @@ afterEach(async () => { }); describe("legacy state dir auto-migration", () => { - it("follows legacy symlink when it points at another legacy dir (clawdbot -> moldbot)", async () => { + it("skips a legacy symlinked state dir when it points outside supported legacy roots", async () => { const root = await makeTempRoot(); const legacySymlink = path.join(root, ".clawdbot"); - const legacyDir = path.join(root, ".moldbot"); + const legacyDir = path.join(root, "legacy-state-source"); fs.mkdirSync(legacyDir, { recursive: true }); fs.writeFileSync(path.join(legacyDir, "marker.txt"), "ok", "utf-8"); @@ -41,12 +41,13 @@ describe("legacy state dir auto-migration", () => { homedir: () => root, }); - expect(result.migrated).toBe(true); - expect(result.warnings).toEqual([]); - - const targetMarker = path.join(root, ".openclaw", "marker.txt"); - expect(fs.readFileSync(targetMarker, "utf-8")).toBe("ok"); - expect(fs.readFileSync(path.join(root, ".moldbot", "marker.txt"), "utf-8")).toBe("ok"); + expect(result.migrated).toBe(false); + expect(result.warnings).toEqual([ + `Legacy state dir is a symlink (${legacySymlink} → ${legacyDir}); skipping auto-migration.`, + ]); + expect(fs.readFileSync(path.join(root, "legacy-state-source", "marker.txt"), "utf-8")).toBe( + "ok", + ); expect(fs.readFileSync(path.join(root, ".clawdbot", "marker.txt"), "utf-8")).toBe("ok"); }); diff --git a/src/plugins/sdk-alias.test.ts b/src/plugins/sdk-alias.test.ts index 47ec4bb4c58..8eda2ea01b1 100644 --- a/src/plugins/sdk-alias.test.ts +++ b/src/plugins/sdk-alias.test.ts @@ -53,7 +53,6 @@ function createPluginSdkAliasFixture(params?: { distFile?: string; srcBody?: string; distBody?: string; - packageName?: string; packageExports?: Record; trustedRootIndicators?: boolean; trustedRootIndicatorMode?: "bin+marker" | "cli-entry-only" | "none"; @@ -67,7 +66,7 @@ function createPluginSdkAliasFixture(params?: { params?.trustedRootIndicatorMode ?? (params?.trustedRootIndicators === false ? "none" : "bin+marker"); const packageJson: Record = { - name: params?.packageName ?? "openclaw", + name: "openclaw", type: "module", }; if (trustedRootIndicatorMode === "bin+marker") { @@ -469,39 +468,11 @@ describe("plugin sdk alias helpers", () => { expect(subpaths).toEqual(["compat", "telegram"]); }); - it("derives plugin-sdk subpaths from nearest package exports even when package name is renamed", () => { - const fixture = createPluginSdkAliasFixture({ - packageName: "moltbot", - packageExports: { - "./plugin-sdk/core": { default: "./dist/plugin-sdk/core.js" }, - "./plugin-sdk/channel-runtime": { default: "./dist/plugin-sdk/channel-runtime.js" }, - "./plugin-sdk/compat": { default: "./dist/plugin-sdk/compat.js" }, - }, - }); - const subpaths = listPluginSdkExportedSubpaths({ - modulePath: path.join(fixture.root, "src", "plugins", "loader.ts"), - }); - expect(subpaths).toEqual(["channel-runtime", "compat", "core"]); - }); - it.each([ - { - name: "derives plugin-sdk subpaths via cwd fallback when module path is a transpiler cache and package is renamed", - fixture: () => - createPluginSdkAliasFixture({ - packageName: "moltbot", - packageExports: { - "./plugin-sdk/core": { default: "./dist/plugin-sdk/core.js" }, - "./plugin-sdk/channel-runtime": { default: "./dist/plugin-sdk/channel-runtime.js" }, - }, - }), - expected: ["channel-runtime", "core"], - }, { name: "does not derive plugin-sdk subpaths from cwd fallback when package root is not an OpenClaw root", fixture: () => createPluginSdkAliasFixture({ - packageName: "moltbot", trustedRootIndicators: false, packageExports: { "./plugin-sdk/core": { default: "./dist/plugin-sdk/core.js" }, @@ -514,7 +485,6 @@ describe("plugin sdk alias helpers", () => { name: "derives plugin-sdk subpaths via cwd fallback when trusted root indicator is cli-entry export", fixture: () => createPluginSdkAliasFixture({ - packageName: "moltbot", trustedRootIndicatorMode: "cli-entry-only", packageExports: { "./plugin-sdk/core": { default: "./dist/plugin-sdk/core.js" }, @@ -630,26 +600,12 @@ describe("plugin sdk alias helpers", () => { }); it.each([ - { - name: "resolves plugin-sdk alias files via cwd fallback when module path is a transpiler cache and package is renamed", - fixture: () => - createPluginSdkAliasFixture({ - srcFile: "channel-runtime.ts", - distFile: "channel-runtime.js", - packageName: "moltbot", - packageExports: { - "./plugin-sdk/channel-runtime": { default: "./dist/plugin-sdk/channel-runtime.js" }, - }, - }), - expected: "src" as const, - }, { name: "does not resolve plugin-sdk alias files from cwd fallback when package root is not an OpenClaw root", fixture: () => createPluginSdkAliasFixture({ srcFile: "channel-runtime.ts", distFile: "channel-runtime.js", - packageName: "moltbot", trustedRootIndicators: false, packageExports: { "./plugin-sdk/channel-runtime": { default: "./dist/plugin-sdk/channel-runtime.js" },