refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -34,7 +34,7 @@ export type GeminiBatchOutputLine = {
};
const GEMINI_BATCH_MAX_REQUESTS = 50000;
const debugEmbeddings = isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
const debugEmbeddings = isTruthyEnvValue(process.env.OPENCLAW_DEBUG_MEMORY_EMBEDDINGS);
const log = createSubsystemLogger("memory/embeddings");
const debugLog = (message: string, meta?: Record<string, unknown>) => {
@@ -83,7 +83,7 @@ function buildGeminiUploadBody(params: { jsonl: string; displayName: string }):
body: Blob;
contentType: string;
} {
const boundary = `moltbot-${hashText(params.displayName)}`;
const boundary = `openclaw-${hashText(params.displayName)}`;
const jsonPart = JSON.stringify({
file: {
displayName: params.displayName,

View File

@@ -103,7 +103,7 @@ async function submitOpenAiBatch(params: {
endpoint: OPENAI_BATCH_ENDPOINT,
completion_window: OPENAI_BATCH_COMPLETION_WINDOW,
metadata: {
source: "moltbot-memory",
source: "openclaw-memory",
agent: params.agentId,
},
}),

View File

@@ -12,7 +12,7 @@ export type GeminiEmbeddingClient = {
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
export const DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
const debugEmbeddings = isTruthyEnvValue(process.env.CLAWDBOT_DEBUG_MEMORY_EMBEDDINGS);
const debugEmbeddings = isTruthyEnvValue(process.env.OPENCLAW_DEBUG_MEMORY_EMBEDDINGS);
const log = createSubsystemLogger("memory/embeddings");
const debugLog = (message: string, meta?: Record<string, unknown>) => {

View File

@@ -1,7 +1,7 @@
import fsSync from "node:fs";
import type { Llama, LlamaEmbeddingContext, LlamaModel } from "node-llama-cpp";
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveUserPath } from "../utils.js";
import { createGeminiEmbeddingProvider, type GeminiEmbeddingClient } from "./embeddings-gemini.js";
import { createOpenAiEmbeddingProvider, type OpenAiEmbeddingClient } from "./embeddings-openai.js";
@@ -27,7 +27,7 @@ export type EmbeddingProviderResult = {
};
export type EmbeddingProviderOptions = {
config: MoltbotConfig;
config: OpenClawConfig;
agentDir?: string;
provider: "openai" | "local" | "gemini" | "auto";
remote?: {
@@ -216,7 +216,7 @@ function formatLocalSetupError(err: unknown): string {
"To enable local embeddings:",
"1) Use Node 22 LTS (recommended for installs/updates)",
missing
? "2) Reinstall Moltbot (this should install node-llama-cpp): npm i -g moltbot@latest"
? "2) Reinstall OpenClaw (this should install node-llama-cpp): npm i -g openclaw@latest"
: null,
"3) If you use pnpm: pnpm approve-builds (select node-llama-cpp), then pnpm rebuild node-llama-cpp",
'Or set agents.defaults.memorySearch.provider = "openai" (remote).',

View File

@@ -43,7 +43,7 @@ describe("memory index", () => {
beforeEach(async () => {
embedBatchCalls = 0;
failEmbeddings = false;
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
await fs.writeFile(

View File

@@ -32,7 +32,7 @@ describe("memory search async sync", () => {
let manager: MemoryIndexManager | null = null;
beforeEach(async () => {
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-async-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-async-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
await fs.writeFile(path.join(workspaceDir, "memory", "2026-01-07.md"), "hello\n");

View File

@@ -43,7 +43,7 @@ describe("memory manager atomic reindex", () => {
beforeEach(async () => {
shouldFail = false;
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
await fs.writeFile(path.join(workspaceDir, "MEMORY.md"), "Hello memory.");

View File

@@ -50,7 +50,7 @@ describe("memory indexing with OpenAI batches", () => {
}
return realSetTimeout(handler, delay, ...args);
}) as typeof setTimeout);
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-batch-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-batch-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
});

View File

@@ -29,7 +29,7 @@ describe("memory embedding batches", () => {
beforeEach(async () => {
embedBatch.mockClear();
embedQuery.mockClear();
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
});

View File

@@ -38,7 +38,7 @@ describe("memory manager sync failures", () => {
beforeEach(async () => {
vi.useFakeTimers();
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
await fs.writeFile(path.join(workspaceDir, "MEMORY.md"), "Hello");

View File

@@ -9,7 +9,7 @@ import chokidar, { type FSWatcher } from "chokidar";
import { resolveAgentDir, resolveAgentWorkspaceDir } from "../agents/agent-scope.js";
import type { ResolvedMemorySearchConfig } from "../agents/memory-search.js";
import { resolveMemorySearchConfig } from "../agents/memory-search.js";
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { onSessionTranscriptUpdate } from "../sessions/transcript-events.js";
@@ -118,7 +118,7 @@ const vectorToBlob = (embedding: number[]): Buffer =>
export class MemoryIndexManager {
private readonly cacheKey: string;
private readonly cfg: MoltbotConfig;
private readonly cfg: OpenClawConfig;
private readonly agentId: string;
private readonly workspaceDir: string;
private readonly settings: ResolvedMemorySearchConfig;
@@ -174,7 +174,7 @@ export class MemoryIndexManager {
private syncing: Promise<void> | null = null;
static async get(params: {
cfg: MoltbotConfig;
cfg: OpenClawConfig;
agentId: string;
}): Promise<MemoryIndexManager | null> {
const { cfg, agentId } = params;
@@ -207,7 +207,7 @@ export class MemoryIndexManager {
private constructor(params: {
cacheKey: string;
cfg: MoltbotConfig;
cfg: OpenClawConfig;
agentId: string;
workspaceDir: string;
settings: ResolvedMemorySearchConfig;

View File

@@ -27,7 +27,7 @@ describe("memory vector dedupe", () => {
let manager: MemoryIndexManager | null = null;
beforeEach(async () => {
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-mem-"));
workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-mem-"));
indexPath = path.join(workspaceDir, "index.sqlite");
await fs.mkdir(path.join(workspaceDir, "memory"));
await fs.writeFile(path.join(workspaceDir, "MEMORY.md"), "Hello memory.");

View File

@@ -1,4 +1,4 @@
import type { MoltbotConfig } from "../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import type { MemoryIndexManager } from "./manager.js";
export type MemorySearchManagerResult = {
@@ -7,7 +7,7 @@ export type MemorySearchManagerResult = {
};
export async function getMemorySearchManager(params: {
cfg: MoltbotConfig;
cfg: OpenClawConfig;
agentId: string;
}): Promise<MemorySearchManagerResult> {
try {