fix(FN-2355): improve AI route diagnostics and stabilize related tests

- Add structured ai-session diagnostics for summarize-title and agent-generation error paths in dashboard routes
- Emit debug-gated summarize request/model resolution diagnostics when FUSION_DEBUG_AI is enabled
- Add route tests that assert diagnostics payloads for summarize and agent generation failures
- Reduce test flakiness by increasing core Vitest timeouts and relaxing brittle extension-discovery argument matching
This commit is contained in:
Fusion
2026-04-24 00:21:23 -07:00
committed by gsxdsm
parent d77c6e198c
commit 11c04f0c43
6 changed files with 214 additions and 16 deletions

View File

@@ -125,7 +125,7 @@ describe("FirstRunDetector", () => {
} finally {
await testCentral.close();
}
});
}, 15_000);
it("should return fresh-install when central DB exists but is unreadable", async () => {
const tempProjectDir = useIsolatedCwd("kb-corrupt-central-");

View File

@@ -88,7 +88,7 @@ export class PluginLoader extends EventEmitter<{
/** Cache of dynamically imported modules */
private loadedModules: Map<string, unknown> = new Map();
/** Monotonic counter for deterministic cache-busting import URLs */
/** Monotonic nonce to guarantee unique cache-busting import URLs. */
private importNonce = 0;
constructor(private options: PluginLoaderOptions) {

View File

@@ -22,6 +22,10 @@ export default defineConfig({
maxWorkers,
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers }, forks: { minForks: 1, maxForks: maxWorkers } },
fileParallelism: true,
// Core runs a large SQLite-heavy suite while other workspace packages test concurrently.
// Use a slightly higher timeout to reduce nondeterministic slow-machine flakes.
testTimeout: 15_000,
hookTimeout: 15_000,
coverage: {
enabled: false,
reporter: ["text", "html", "json"],