fix(coding-agent): defer startup model catalog refresh
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user