openai-codex: bridge OAuth profiles into pi auth.json for model discovery (#15184)

This commit is contained in:
loiie45e
2026-02-13 19:39:37 +08:00
committed by GitHub
parent e3cb2564d7
commit 07faab6ac3
4 changed files with 147 additions and 0 deletions

View File

@@ -91,6 +91,9 @@ export async function loadModelCatalog(params?: {
try {
const cfg = params?.config ?? loadConfig();
await ensureOpenClawModelsJson(cfg);
await (
await import("./pi-auth-json.js")
).ensurePiAuthJsonFromAuthProfiles(resolveOpenClawAgentDir());
// 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