fix(FN-2090): log and cover engine warning fallbacks
- Add structured warning logs for plugin-runner fallback paths instead of silent catches - Add warning telemetry in agent-tools for agent-memory directory, QMD search, and index refresh failures - Log cron-runner session disposal failures and update agent-logger persistence warnings to use logger output - Expand engine tests to cover warning behavior across plugin-runner, agent-tools, cron-runner, and agent-logger
This commit is contained in:
@@ -630,6 +630,7 @@ export async function createAiPromptExecutor(cwd: string): Promise<AiPromptExecu
|
||||
// We import lazily to keep the factory self-contained and to avoid
|
||||
// pulling pi.ts into the module graph when AI execution isn't used.
|
||||
const { createKbAgent, promptWithFallback } = await import("./pi.js");
|
||||
const disposeLog = createLogger("cron-runner");
|
||||
|
||||
return async (prompt: string, modelProvider?: string, modelId?: string): Promise<string> => {
|
||||
let responseText = "";
|
||||
@@ -651,8 +652,8 @@ export async function createAiPromptExecutor(cwd: string): Promise<AiPromptExecu
|
||||
} finally {
|
||||
try {
|
||||
session.dispose();
|
||||
} catch {
|
||||
// Best-effort disposal — don't mask the original error
|
||||
} catch (err) {
|
||||
disposeLog.warn(`Session disposal failed: ${err instanceof Error ? err.message : String(err)}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user