Skip to content

Commit 83e2c2a

Browse files
committed
Fix the catalog-cache CI failures after updating the branch.
Format the gateway fetcher, ignore the test-only cache helpers in production analysis, and unwrap the gateway catalog result in the adapter tests.
1 parent 4d6acc2 commit 83e2c2a

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎knip.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"ignoreDependencies": ["lint-staged"],
1717
"ignoreBinaries": ["dotenvx"],
1818
"ignoreExportsUsedInFile": true,
19+
"tags": ["-@knipignore"],
1920
"playwright": false,
2021
"playwright-ct": false,
2122
"workspaces": {

‎src/api/providers/__tests__/model-catalog-adapters.spec.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ describe("model catalog adapters", () => {
267267
fetcher.mockReset()
268268
fetcher.mockResolvedValue(CATALOG)
269269
}
270+
fetchers.getZooGatewayModels.mockResolvedValue({ kind: "ok", models: CATALOG })
270271
})
271272

272273
describe.each(cases)("$name", ({ create, fetcher, scope, expectedArgs, forwardsSignal }) => {

‎src/api/providers/fetchers/modelCache.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,8 @@ export function getModelsFromCache(options: GetModelsOptions, handler: ApiHandle
877877
/**
878878
* Clears auth-session maps and the empty-response throttle for test isolation.
879879
* Prefer this over `vi.resetModules()` so mutation testing instruments the same module instance.
880+
*
881+
* @knipignore
880882
*/
881883
export function resetModelCacheTransientStateForTests(): void {
882884
// Stryker disable next-line CallExpression: test-only reset; per-mutant runs do not require cross-test isolation
@@ -891,7 +893,11 @@ export function resetModelCacheTransientStateForTests(): void {
891893
inFlightRefresh.clear()
892894
}
893895

894-
/** Test-only: observe clear-generation map size (non-auth clears must not insert entries). */
896+
/**
897+
* Test-only: observe clear-generation map size (non-auth clears must not insert entries).
898+
*
899+
* @knipignore
900+
*/
895901
export function authScopedClearGenerationSizeForTests(): number {
896902
return authScopedClearGeneration.size
897903
}

‎src/api/providers/fetchers/zoo-gateway.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const MODEL_DISCOVERY_TIMEOUT_MS = 15_000
2121
*/
2222

2323
export type ZooGatewayModelsFetchResult =
24-
| { kind: "ok"; models: Record<string, ModelInfo>; etag?: string }
25-
| { kind: "not_modified" }
24+
{ kind: "ok"; models: Record<string, ModelInfo>; etag?: string } | { kind: "not_modified" }
2625

2726
export async function getZooGatewayModels(
2827
options?: ApiHandlerOptions & { ifNoneMatch?: string },

0 commit comments

Comments
 (0)