mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:51:23 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { type ClawdbotConfig, loadConfig } from "../config/config.js";
|
||||
import { resolveClawdbotAgentDir } from "./agent-paths.js";
|
||||
import { ensureClawdbotModelsJson } from "./models-config.js";
|
||||
import { type MoltbotConfig, loadConfig } from "../config/config.js";
|
||||
import { resolveMoltbotAgentDir } from "./agent-paths.js";
|
||||
import { ensureMoltbotModelsJson } from "./models-config.js";
|
||||
|
||||
export type ModelCatalogEntry = {
|
||||
id: string;
|
||||
@@ -39,7 +39,7 @@ export function __setModelCatalogImportForTest(loader?: () => Promise<PiSdkModul
|
||||
}
|
||||
|
||||
export async function loadModelCatalog(params?: {
|
||||
config?: ClawdbotConfig;
|
||||
config?: MoltbotConfig;
|
||||
useCache?: boolean;
|
||||
}): Promise<ModelCatalogEntry[]> {
|
||||
if (params?.useCache === false) {
|
||||
@@ -57,13 +57,13 @@ export async function loadModelCatalog(params?: {
|
||||
});
|
||||
try {
|
||||
const cfg = params?.config ?? loadConfig();
|
||||
await ensureClawdbotModelsJson(cfg);
|
||||
await ensureMoltbotModelsJson(cfg);
|
||||
// IMPORTANT: keep the dynamic import *inside* the try/catch.
|
||||
// If this fails once (e.g. during a pnpm install that temporarily swaps node_modules),
|
||||
// we must not poison the cache with a rejected promise (otherwise all channel handlers
|
||||
// will keep failing until restart).
|
||||
const piSdk = await importPiSdk();
|
||||
const agentDir = resolveClawdbotAgentDir();
|
||||
const agentDir = resolveMoltbotAgentDir();
|
||||
const authStorage = piSdk.discoverAuthStorage(agentDir);
|
||||
const registry = piSdk.discoverModels(authStorage, agentDir) as
|
||||
| {
|
||||
|
||||
Reference in New Issue
Block a user