fix(insights): let "Re-run analysis" reach a benched provider

The on-demand briefing (POST /api/insights/generate) runs through the
briefing chokepoint, which named its chain walk "job" for the background
share of the day's ceiling. Since background work leaves out a provider the
health ledger benched, a person pressing "Re-run analysis" got no request at
all: the call failed with a connection refusal that never happened, and a
refused credential was never reported back.

The chain runners now take the walk apart from the budget surface: a call
can be rationed as a job and still have a person waiting on it
(interactive). runBriefingCompletion takes the flag and the on-demand
route's calls (the first pass and the grounding retry) pass it, so they keep
the job share and walk a benched provider at the tail, as background-bench
promises for interactive walks. Every other job-surface caller is a worker
or is enqueued; the status, narrative and warm routes only read and queue,
and document reads and lab scans resolve a single provider without a chain.

Refs #1279
This commit is contained in:
Marc-André Bombeck committed 2026-10-25 00:24:51 +02:00
1 parent b90980f2a2
commit bdfcea5e7c
7 files changed
+110 -42

No files matched your search

@@ -1,7 +1,7 @@
{
"$comment": "Comment lines that open with a release version, per file under src/. Maintained by src/__tests__/version-stamp-ratchet.test.ts.",
"count": 2897,
"total": 9263,
"total": 9262,
"entries": {
"__tests__/account-payload-consumer-guard.test.ts": 2,
"__tests__/acting-account-boundary-guard.test.ts": 7,
@@ -1783,7 +1783,7 @@
"lib/ai/prompts/weight.ts": 2,
"lib/ai/provider-chain.ts": 1,
"lib/ai/provider-health-ledger.ts": 3,
"lib/ai/provider-runner.ts": 15,
"lib/ai/provider-runner.ts": 14,
"lib/ai/provider.ts": 10,
"lib/ai/reasoning/__tests__/controls.test.ts": 1,
"lib/ai/reasoning/controls.ts": 2,