authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:19:37-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:19:37-07:00
log31fb21009024e9476bda4705355d55491d7fd2ef
tree585de7d72233676166f8d4c827821257a68b914e
parenteced382b451abc35137e7047b010c6ae5f6e9353
signature Signed by PGP key B5690EEEBB952194

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


2 files changed, 1 insertions(+), 3 deletions(-)

apps/server/src/provider/ModelManifest.test.ts-2
......@@ -17,7 +17,6 @@ import {
1717 make,
1818 resolveProviderCatalog,
1919 type ModelManifestData,
20 manifestUpdatedAtMs,
2120 encodeManifestCache,
2221} from "./ModelManifest.ts";
2322
......@@ -382,7 +381,6 @@ describe("ModelManifest service", () => {
382381 const fs = yield* FileSystem.FileSystem;
383382 const path = yield* Path.Path;
384383 const config = yield* ServerConfig.ServerConfig;
385 assert.isAbove(manifestUpdatedAtMs(BUNDLED_MODEL_MANIFEST), 0);
386384 const cachePath = path.join(config.stateDir, "model-manifest.json");
387385 // A cache of the manifest as it was before the release edited it. The
388386 // fetch time is irrelevant: the remote may be unreachable now, so
apps/server/src/provider/ModelManifest.ts+1-1
......@@ -138,7 +138,7 @@ export const BUNDLED_MODEL_MANIFEST: ModelManifestData =
138138 Schema.decodeUnknownSync(ModelManifestSchema)(bundledManifestJson);
139139
140140/** Epoch millis of the manifest's `updatedAt`, or 0 when absent or unparsable. */
141export function manifestUpdatedAtMs(manifest: ModelManifestData): number {
141function manifestUpdatedAtMs(manifest: ModelManifestData): number {
142142 if (manifest.updatedAt === undefined) return 0;
143143 const parsed = Date.parse(manifest.updatedAt);
144144 return Number.isNaN(parsed) ? 0 : parsed;