mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 21:04:33 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -26,7 +26,7 @@ beforeEach(() => {
|
||||
|
||||
readConfigFileSnapshot.mockReset();
|
||||
writeConfigFile.mockReset().mockResolvedValue(undefined);
|
||||
resolveClawdbotPackageRoot.mockReset().mockResolvedValue(null);
|
||||
resolveMoltbotPackageRoot.mockReset().mockResolvedValue(null);
|
||||
runGatewayUpdate.mockReset().mockResolvedValue({
|
||||
status: "skipped",
|
||||
mode: "unknown",
|
||||
@@ -34,7 +34,7 @@ beforeEach(() => {
|
||||
durationMs: 0,
|
||||
});
|
||||
legacyReadConfigFileSnapshot.mockReset().mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
path: "/tmp/moltbot.json",
|
||||
exists: false,
|
||||
raw: null,
|
||||
parsed: {},
|
||||
@@ -78,7 +78,7 @@ beforeEach(() => {
|
||||
originalStateDir = process.env.CLAWDBOT_STATE_DIR;
|
||||
originalUpdateInProgress = process.env.CLAWDBOT_UPDATE_IN_PROGRESS;
|
||||
process.env.CLAWDBOT_UPDATE_IN_PROGRESS = "1";
|
||||
tempStateDir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-doctor-state-"));
|
||||
tempStateDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-doctor-state-"));
|
||||
process.env.CLAWDBOT_STATE_DIR = tempStateDir;
|
||||
fs.mkdirSync(path.join(tempStateDir, "agents", "main", "sessions"), {
|
||||
recursive: true,
|
||||
@@ -109,7 +109,7 @@ const confirm = vi.fn().mockResolvedValue(true);
|
||||
const select = vi.fn().mockResolvedValue("node");
|
||||
const note = vi.fn();
|
||||
const writeConfigFile = vi.fn().mockResolvedValue(undefined);
|
||||
const resolveClawdbotPackageRoot = vi.fn().mockResolvedValue(null);
|
||||
const resolveMoltbotPackageRoot = vi.fn().mockResolvedValue(null);
|
||||
const runGatewayUpdate = vi.fn().mockResolvedValue({
|
||||
status: "skipped",
|
||||
mode: "unknown",
|
||||
@@ -133,7 +133,7 @@ const runCommandWithTimeout = vi.fn().mockResolvedValue({
|
||||
const ensureAuthProfileStore = vi.fn().mockReturnValue({ version: 1, profiles: {} });
|
||||
|
||||
const legacyReadConfigFileSnapshot = vi.fn().mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
path: "/tmp/moltbot.json",
|
||||
exists: false,
|
||||
raw: null,
|
||||
parsed: {},
|
||||
@@ -173,14 +173,14 @@ vi.mock("../agents/skills-status.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../plugins/loader.js", () => ({
|
||||
loadClawdbotPlugins: () => ({ plugins: [], diagnostics: [] }),
|
||||
loadMoltbotPlugins: () => ({ plugins: [], diagnostics: [] }),
|
||||
}));
|
||||
|
||||
vi.mock("../config/config.js", async (importOriginal) => {
|
||||
const actual = await importOriginal();
|
||||
return {
|
||||
...actual,
|
||||
CONFIG_PATH_CLAWDBOT: "/tmp/clawdbot.json",
|
||||
CONFIG_PATH: "/tmp/moltbot.json",
|
||||
createConfigIO,
|
||||
readConfigFileSnapshot,
|
||||
writeConfigFile,
|
||||
@@ -215,8 +215,8 @@ vi.mock("../process/exec.js", () => ({
|
||||
runCommandWithTimeout,
|
||||
}));
|
||||
|
||||
vi.mock("../infra/clawdbot-root.js", () => ({
|
||||
resolveClawdbotPackageRoot,
|
||||
vi.mock("../infra/moltbot-root.js", () => ({
|
||||
resolveMoltbotPackageRoot,
|
||||
}));
|
||||
|
||||
vi.mock("../infra/update-runner.js", () => ({
|
||||
@@ -330,7 +330,7 @@ vi.mock("./doctor-update.js", () => ({
|
||||
describe("doctor command", () => {
|
||||
it("warns when the state directory is missing", async () => {
|
||||
readConfigFileSnapshot.mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
path: "/tmp/moltbot.json",
|
||||
exists: true,
|
||||
raw: "{}",
|
||||
parsed: {},
|
||||
@@ -340,7 +340,7 @@ describe("doctor command", () => {
|
||||
legacyIssues: [],
|
||||
});
|
||||
|
||||
const missingDir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-missing-state-"));
|
||||
const missingDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-missing-state-"));
|
||||
fs.rmSync(missingDir, { recursive: true, force: true });
|
||||
process.env.CLAWDBOT_STATE_DIR = missingDir;
|
||||
note.mockClear();
|
||||
@@ -358,7 +358,7 @@ describe("doctor command", () => {
|
||||
|
||||
it("warns about opencode provider overrides", async () => {
|
||||
readConfigFileSnapshot.mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
path: "/tmp/moltbot.json",
|
||||
exists: true,
|
||||
raw: "{}",
|
||||
parsed: {},
|
||||
@@ -392,7 +392,7 @@ describe("doctor command", () => {
|
||||
|
||||
it("skips gateway auth warning when CLAWDBOT_GATEWAY_TOKEN is set", async () => {
|
||||
readConfigFileSnapshot.mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
path: "/tmp/moltbot.json",
|
||||
exists: true,
|
||||
raw: "{}",
|
||||
parsed: {},
|
||||
|
||||
Reference in New Issue
Block a user