refactor(server): keep manifest age parsing private (#10028)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 01:19:37 -07:00
1 parent eced382b45
commit 31fb210090
2 files changed
+1 -3

No files matched your search

@@ -17,7 +17,6 @@ import {
make,
resolveProviderCatalog,
type ModelManifestData,
manifestUpdatedAtMs,
encodeManifestCache,
} from "./ModelManifest.ts";
@@ -382,7 +381,6 @@ describe("ModelManifest service", () => {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const config = yield* ServerConfig.ServerConfig;
assert.isAbove(manifestUpdatedAtMs(BUNDLED_MODEL_MANIFEST), 0);
const cachePath = path.join(config.stateDir, "model-manifest.json");
// A cache of the manifest as it was before the release edited it. The
// fetch time is irrelevant: the remote may be unreachable now, so
+1 -1
View File
@@ -138,7 +138,7 @@ export const BUNDLED_MODEL_MANIFEST: ModelManifestData =
Schema.decodeUnknownSync(ModelManifestSchema)(bundledManifestJson);
/** Epoch millis of the manifest's `updatedAt`, or 0 when absent or unparsable. */
export function manifestUpdatedAtMs(manifest: ModelManifestData): number {
function manifestUpdatedAtMs(manifest: ModelManifestData): number {
if (manifest.updatedAt === undefined) return 0;
const parsed = Date.parse(manifest.updatedAt);
return Number.isNaN(parsed) ? 0 : parsed;