fix: avoid eager web provider config reads

This commit is contained in:
Peter Steinberger 2026-04-05 09:33:50 +01:00
parent 0b8336f49d
commit 22db77d2b6
No known key found for this signature in database
3 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import { EnvHttpProxyAgent } from "undici";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createEmptyPluginRegistry } from "../../plugins/registry.js";
import { setActivePluginRegistry } from "../../plugins/runtime.js";
import { clearSecretsRuntimeSnapshot } from "../../secrets/runtime.js";
import { withFetchPreconnect } from "../../test-utils/fetch-mock.js";
import { __testing as webSearchTesting } from "./web-search.js";
import { createWebFetchTool, createWebSearchTool } from "./web-tools.js";
@ -152,8 +153,14 @@ function createProviderSuccessPayload(
};
}
beforeEach(() => {
setActivePluginRegistry(createEmptyPluginRegistry());
clearSecretsRuntimeSnapshot();
});
afterEach(() => {
setActivePluginRegistry(createEmptyPluginRegistry());
clearSecretsRuntimeSnapshot();
});
describe("web tools defaults", () => {

View File

@ -62,7 +62,6 @@ function buildWebFetchSnapshotCacheKey(params: {
onlyPluginIds: [...new Set(params.onlyPluginIds ?? [])].toSorted((left, right) =>
left.localeCompare(right),
),
config: params.config ?? null,
env: buildPluginSnapshotCacheEnvKey(params.env),
});
}

View File

@ -61,7 +61,6 @@ function buildWebSearchSnapshotCacheKey(params: {
onlyPluginIds: [...new Set(params.onlyPluginIds ?? [])].toSorted((left, right) =>
left.localeCompare(right),
),
config: params.config ?? null,
env: buildPluginSnapshotCacheEnvKey(params.env),
});
}