fix(FN-1952): restore pi auth and extension loading
This commit is contained in:
@@ -57,8 +57,11 @@ async function initEngine() {
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize on module load (will be awaited in actual usage)
|
||||
const engineReady = initEngine();
|
||||
let engineReady: Promise<void> | undefined;
|
||||
function ensureEngineReady() {
|
||||
engineReady ??= initEngine();
|
||||
return engineReady;
|
||||
}
|
||||
|
||||
// ── Constants ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -212,6 +215,7 @@ function cleanupExpiredSessions(): void {
|
||||
}
|
||||
|
||||
const cleanupInterval = setInterval(cleanupExpiredSessions, CLEANUP_INTERVAL_MS);
|
||||
cleanupInterval.unref?.();
|
||||
|
||||
process.on("beforeExit", () => {
|
||||
clearInterval(cleanupInterval);
|
||||
@@ -461,7 +465,7 @@ export async function generateAgentSpec(
|
||||
}
|
||||
|
||||
try {
|
||||
await engineReady;
|
||||
await ensureEngineReady();
|
||||
await promptCatalogReadyPromise;
|
||||
const spec = await generateSpecWithAI(session, rootDir, promptOverrides);
|
||||
session.spec = spec;
|
||||
|
||||
Reference in New Issue
Block a user