diff --git a/src/agents/tools/web-fetch.ts b/src/agents/tools/web-fetch.ts index 9b0689d6db5..e618238e2e5 100644 --- a/src/agents/tools/web-fetch.ts +++ b/src/agents/tools/web-fetch.ts @@ -516,7 +516,8 @@ async function maybeFetchFirecrawlWebFetchPayload( async function runWebFetch(params: WebFetchRuntimeParams): Promise> { // Include ssrfPolicy in cache key to prevent cross-policy cache bypass - const ssrfPolicySuffix = params.ssrfPolicy?.allowRfc2544BenchmarkRange ? ":rfc2544" : ""; + // Use JSON.stringify to encode the full policy object, ensuring future fields are automatically included + const ssrfPolicySuffix = params.ssrfPolicy ? `:${JSON.stringify(params.ssrfPolicy)}` : ""; const cacheKey = normalizeCacheKey( `fetch:${params.url}:${params.extractMode}:${params.maxChars}${ssrfPolicySuffix}`, );