mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:57:40 +00:00
Agents: update pi dependencies to 0.50.7
This commit is contained in:
@@ -68,7 +68,9 @@ export async function applyAuthChoiceOAuth(
|
||||
});
|
||||
|
||||
spin.stop("Chutes OAuth complete");
|
||||
const email = creds.email?.trim() || "default";
|
||||
const email =
|
||||
(typeof creds.email === "string" ? creds.email.trim() : String(creds.email ?? "").trim()) ||
|
||||
"default";
|
||||
const profileId = `chutes:${email}`;
|
||||
|
||||
await writeOAuthCredentials("chutes", creds, params.agentDir);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { join } from "node:path";
|
||||
|
||||
import type { Api, Model } from "@mariozechner/pi-ai";
|
||||
import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent";
|
||||
import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
import { resolveOpenClawAgentDir } from "../../agents/agent-paths.js";
|
||||
import type { AuthProfileStore } from "../../agents/auth-profiles.js";
|
||||
@@ -41,8 +43,8 @@ const hasAuthForProvider = (provider: string, cfg: OpenClawConfig, authStore: Au
|
||||
export async function loadModelRegistry(cfg: OpenClawConfig) {
|
||||
await ensureOpenClawModelsJson(cfg);
|
||||
const agentDir = resolveOpenClawAgentDir();
|
||||
const authStorage = discoverAuthStorage(agentDir);
|
||||
const registry = discoverModels(authStorage, agentDir);
|
||||
const authStorage = new AuthStorage(join(agentDir, "auth.json"));
|
||||
const registry = new ModelRegistry(authStorage, join(agentDir, "models.json"));
|
||||
const models = registry.getAll() as Model<Api>[];
|
||||
const availableModels = registry.getAvailable() as Model<Api>[];
|
||||
const availableKeys = new Set(availableModels.map((model) => modelKey(model.provider, model.id)));
|
||||
|
||||
Reference in New Issue
Block a user