Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions apps/server/src/provider/ModelManifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,31 +523,26 @@ describe("ModelManifest service", () => {
),
);

it.live("does not fetch when provider update checks are disabled", () =>
Effect.gen(function* () {
let fetchCount = 0;
const service = yield* make.pipe(
Effect.provide(
httpClientLayer(() => {
fetchCount += 1;
return Response.json(REMOTE_MANIFEST);
}),
),
);
assert.deepStrictEqual(yield* service.refresh, BUNDLED_MODEL_MANIFEST);
assert.deepStrictEqual(yield* service.forceRefresh, BUNDLED_MODEL_MANIFEST);
assert.strictEqual(fetchCount, 0);
it.live("still fetches when provider update checks are disabled", () => {
let fetchCount = 0;
return Effect.gen(function* () {
const service = yield* make;
assert.deepStrictEqual(yield* service.refresh, REMOTE_MANIFEST);
assert.strictEqual(fetchCount, 1);
}).pipe(
Effect.scoped,
Effect.provide(
serviceLayers({
prefix: "model-manifest-optout-test",
response: () => Response.json(REMOTE_MANIFEST),
response: () => {
fetchCount += 1;
return Response.json(REMOTE_MANIFEST);
},
settings: { enableProviderUpdateChecks: false },
}),
),
),
);
);
});
});

it.effect("caches valid compatibility policies and keeps them after a malformed refresh", () => {
Expand Down
11 changes: 0 additions & 11 deletions apps/server/src/provider/ModelManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import * as Semaphore from "effect/Semaphore";
import { HttpClient, HttpClientResponse } from "effect/unstable/http";

import { ServerConfig } from "../config.ts";
import * as ServerSettings from "../serverSettings.ts";
import { hasValidClaudeManifestAdapters } from "./ClaudeModelManifest.ts";
import bundledManifestJson from "./model-manifest.json" with { type: "json" };
import { ProviderCompatibilityPolicy } from "./providerCompatibility.ts";
Expand Down Expand Up @@ -340,7 +339,6 @@ export const make = Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const config = yield* ServerConfig;
const settingsService = yield* ServerSettings.ServerSettingsService;
const httpClient = yield* HttpClient.HttpClient;
const serviceScope = yield* Effect.scope;

Expand Down Expand Up @@ -385,15 +383,6 @@ export const make = Effect.gen(function* () {
if (!force && isWithin(fetchedAtMs, MANIFEST_TTL_MS)) return manifest;
if (!force && isWithin(lastAttemptMs, MANIFEST_RETRY_MS)) return manifest;

// The same switch that gates provider CLI update checks. It stops network
// fetches only: a manifest already cached on disk from an earlier fetch
// stays in effect, since the setting is about phoning home, not about
// discarding data the server already holds.
const settings = yield* settingsService.getSettings.pipe(
Effect.catchCause(() => Effect.succeed(null)),
);
if (settings !== null && !settings.enableProviderUpdateChecks) return manifest;

lastAttemptMs = now;
const fetched = yield* httpClient.get(MODEL_MANIFEST_URL).pipe(
Effect.flatMap(HttpClientResponse.filterStatusOk),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes refresh behavior when enableProviderUpdateChecks is false, but the corresponding test was removed without a replacement. Could you add a focused test using the existing HTTP test layer that disables update checks and verifies refresh still fetches the remote manifest? This protects the new independence from the setting. The fix spans the service and test files, so no single-hunk suggestion applies.

Posted via Macroscope — Effect Service Conventions

@Vrtak-CZ Vrtak-CZ Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bccc53b6fc. I restored the test, flipped: with enableProviderUpdateChecks: false, refresh still fetches the remote manifest, with exactly one HTTP request. It fails against the previous code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Expand Down
Loading