Skip to content
Source
Sign inSign up
TanStack/schemas

Clear a docs-failing row when an adapter stops reporting docs failures #678

Mergedtombeckenhammerged 1 commit intomain fromrefs/pull/678/headmerged by tombeckenham View on GitHub

Showing 5 changed files with 83 additions and 14 deletions (loading 2).

x
0 of 5 viewed, 5 left
60 additions and 0 deletionssrc/server/ingest/docs-absent-recovery.worker.test.tsAdded
View file
@@ -0,0 +1,60 @@
+import { env } from 'cloudflare:test'
+import { expect, it } from 'vitest'
+import { getDb } from '../../db/index.ts'
+import { providers } from '../../db/schema.ts'
+import type { ProviderConfig } from '../providers/types.ts'
+import { recordDocsFailing, readDocsFailing } from './docs-failing.ts'
+import { pollProviderModels } from './poll-models.ts'
+​
+it('clears a docs-failing row when listModels omits docsFailures', async () => {
+ const id = 'docs-absent'
+ const db = getDb(env)
+ await db.insert(providers).values({
+ id,
+ displayName: 'Docs absent',
+ specSourceUrl: 'https://example.com/models',
+ })
+ await recordDocsFailing(
+ db,
+ id,
+ {
+ failed: 1,
+ skipped: 0,
+ first: [
+ {
+ source: 'https://example.com/docs',
+ error: 'privacy training cell "30 days" for Grok 4.7',
+ elapsedMs: 1,