fix(FN-1952): restore pi auth and extension loading
This commit is contained in:
@@ -101,7 +101,11 @@ async function initEngine() {
|
||||
}
|
||||
}
|
||||
|
||||
const engineReady = initEngine();
|
||||
let engineReady: Promise<void> | undefined;
|
||||
function ensureEngineReady() {
|
||||
engineReady ??= initEngine();
|
||||
return engineReady;
|
||||
}
|
||||
|
||||
// ── Constants ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -492,6 +496,7 @@ function cleanupExpiredSessions(): void {
|
||||
}
|
||||
|
||||
const cleanupInterval = setInterval(cleanupExpiredSessions, CLEANUP_INTERVAL_MS);
|
||||
cleanupInterval.unref?.();
|
||||
process.on("beforeExit", () => clearInterval(cleanupInterval));
|
||||
|
||||
// ── Stream Manager ──────────────────────────────────────────────────────────
|
||||
@@ -671,7 +676,7 @@ async function createTargetInterviewAgent(
|
||||
session: TargetInterviewSession,
|
||||
rootDir: string,
|
||||
): Promise<AgentResult> {
|
||||
await engineReady;
|
||||
await ensureEngineReady();
|
||||
|
||||
return createKbAgent({
|
||||
cwd: rootDir,
|
||||
|
||||
Reference in New Issue
Block a user