fix(insights): wait as long as the response timeout allows in the browser

The regenerate button aborted its inline POST after a fixed 45 s, so on a
slow local model every regenerate was cut while the server still had
minutes left on the person's setting. It now uses clientAbortMs over the
route's sequential model calls, never less per call than the briefing's
own 180 s default, because the published value cannot say whether the
person set it.

A save of the about-me self-context derives the clarifying questions
inline and ran under the 15 s request default, which reported a failed
save while the server went on to commit it. All six save sites now take
their abort from the same setting. Every other browser request that waits
on a model either has no client timeout or only queues the work.

Refs #1267
This commit is contained in:
Marc-André Bombeck committed 2026-10-22 13:01:20 +02:00
1 parent 221960af88
commit 6d250d092d
17 files changed
+289 -27

No files matched your search

@@ -17,6 +17,8 @@ vi.mock("@/hooks/use-ai-capability", () => ({
}),
// v1.41 — the thinking depth reads the resolved block; none here.
useCoachReasoning: () => null,
// #1267 — the about-me save's abort, from the response-timeout setting.
useAboutMeSaveTimeoutMs: () => 90_000,
}));
vi.mock("next/navigation", () => ({
useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),
@@ -33,6 +33,8 @@ vi.mock("@/hooks/use-ai-capability", () => ({
reason: null,
onDeviceAllowed: true,
}),
// #1267 — the about-me save's abort, from the response-timeout setting.
useAboutMeSaveTimeoutMs: () => 90_000,
}));
vi.mock("next/navigation", () => ({