Skip to content

Commit 68e6009

Browse files
committed
fix(server): refresh model catalog without CLI update checks
Provider update checks skipped both CLI version lookups and the remote model-manifest fetch, so new models stayed out of the picker until the setting was turned back on. Catalog refresh now ignores that switch. CLI version checks stay gated.
1 parent 921cb3c commit 68e6009

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

‎apps/server/src/provider/ModelManifest.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ describe("ModelManifest service", () => {
547547
),
548548
);
549549

550-
it.live("does not fetch when provider update checks are disabled", () =>
550+
it.live("fetches the remote manifest when provider update checks are disabled", () =>
551551
Effect.gen(function* () {
552552
let fetchCount = 0;
553553
const service = yield* make.pipe(
@@ -558,9 +558,12 @@ describe("ModelManifest service", () => {
558558
}),
559559
),
560560
);
561-
assert.deepStrictEqual(yield* service.refresh, BUNDLED_MODEL_MANIFEST);
562-
assert.deepStrictEqual(yield* service.forceRefresh, BUNDLED_MODEL_MANIFEST);
563-
assert.strictEqual(fetchCount, 0);
561+
assert.deepStrictEqual(yield* service.refresh, REMOTE_MANIFEST);
562+
assert.strictEqual(fetchCount, 1);
563+
// Explicit refresh (Settings → Providers → Refresh provider status)
564+
// uses the same path and must stay independent of the CLI check switch.
565+
assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
566+
assert.strictEqual(fetchCount, 2);
564567
}).pipe(
565568
Effect.scoped,
566569
Effect.provide(

‎apps/server/src/provider/ModelManifest.ts‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import * as Semaphore from "effect/Semaphore";
3131
import { HttpClient, HttpClientResponse } from "effect/unstable/http";
3232

3333
import { ServerConfig } from "../config.ts";
34-
import * as ServerSettings from "../serverSettings.ts";
3534
import { hasValidClaudeManifestAdapters } from "./ClaudeModelManifest.ts";
3635
import bundledManifestJson from "./model-manifest.json" with { type: "json" };
3736
import { ProviderCompatibilityPolicy } from "./providerCompatibility.ts";
@@ -340,7 +339,6 @@ export const make = Effect.gen(function* () {
340339
const fileSystem = yield* FileSystem.FileSystem;
341340
const path = yield* Path.Path;
342341
const config = yield* ServerConfig;
343-
const settingsService = yield* ServerSettings.ServerSettingsService;
344342
const httpClient = yield* HttpClient.HttpClient;
345343
const serviceScope = yield* Effect.scope;
346344

@@ -385,15 +383,8 @@ export const make = Effect.gen(function* () {
385383
if (!force && isWithin(fetchedAtMs, MANIFEST_TTL_MS)) return manifest;
386384
if (!force && isWithin(lastAttemptMs, MANIFEST_RETRY_MS)) return manifest;
387385

388-
// The same switch that gates provider CLI update checks. It stops network
389-
// fetches only: a manifest already cached on disk from an earlier fetch
390-
// stays in effect, since the setting is about phoning home, not about
391-
// discarding data the server already holds.
392-
const settings = yield* settingsService.getSettings.pipe(
393-
Effect.catchCause(() => Effect.succeed(null)),
394-
);
395-
if (settings !== null && !settings.enableProviderUpdateChecks) return manifest;
396-
386+
// Catalog refresh is independent of Settings → Provider update checks.
387+
// That switch only gates CLI version lookups.
397388
lastAttemptMs = now;
398389
const fetched = yield* httpClient.get(MODEL_MANIFEST_URL).pipe(
399390
Effect.flatMap(HttpClientResponse.filterStatusOk),

0 commit comments

Comments
 (0)