fix(coding-agent): defer startup model catalog refresh

This commit is contained in:
Mario Zechner
2026-07-20 17:13:06 +02:00
parent f8b74a4507
commit c889eb8809
4 changed files with 41 additions and 15 deletions
+14
View File
@@ -91,6 +91,20 @@ describe("Radius provider", () => {
expect(vi.mocked(fetch).mock.calls[0]?.[1]?.headers).toMatchObject({ authorization: "Bearer access-token" });
});
it("does not refresh catalogs over the network by default", async () => {
const fetchSpy = vi.spyOn(globalThis, "fetch");
const runtime = await ModelRuntime.create({
credentials: AuthStorage.inMemory({
[RADIUS_PROVIDER_ID]: radiusOAuthCredential("https://radius.example.com/v1"),
}),
modelsStore: new InMemoryModelsStore(),
modelsPath: null,
});
expect(runtime.getModel(RADIUS_PROVIDER_ID, "auto")).toBeDefined();
expect(fetchSpy).not.toHaveBeenCalled();
});
it("does not fetch or expose Radius models without configured auth", async () => {
const fetchSpy = vi.spyOn(globalThis, "fetch");
const runtime = await ModelRuntime.create({