test(onboarding): the AI panel names the variant it settled on

The panel paints before its status query answers, and every variant inside it
is conditional, so an assertion that a variant is absent could pass on a
question that had simply not been answered yet — which is how the journey for
the unmeasured-provider case passed on a retry against the very defect it was
written to catch.

The panel now carries the variant it settled on, absent until it has settled,
and the three journeys wait on that instead of racing it. The third journey
covers the state a freshly deployed instance is in before its first AI call:
no offer, and no claim of an outage either.
This commit is contained in:
Marc-André Bombeck committed 2026-09-11 11:15:39 +02:00
1 parent 41596d1cb8
commit 34caeeea3c
4 files changed
+92 -3

No files matched your search

+17
View File
@@ -117,6 +117,23 @@ export async function seedSharedProviderResult(
}
}
/**
* The ledger holds nothing for either shared tag, with the operator's key
* still in place: a brand-new instance before its first AI call, which is
* what every deployment looks like until somebody makes one.
*/
export async function clearSharedProviderResult(): Promise<void> {
const pool = connect();
try {
await pool.query(
`DELETE FROM provider_health
WHERE provider_type IN ('admin-openai', 'admin-codex')`,
);
} finally {
await pool.end();
}
}
/** No receipt on file — the state a fresh account reaches the screen in. */
export async function clearAiConsent(username: string): Promise<void> {
const pool = connect();