mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-01 00:40:42 -07:00
fix(core): update web_fetch skip reasons to match E2E expectations
This commit is contained in:
@@ -423,7 +423,7 @@ describe('WebFetchTool', () => {
|
||||
'[Warning] The following URLs were skipped:',
|
||||
);
|
||||
expect(result.llmContent).toContain(
|
||||
'[Rate Limit] https://ratelimit-multi.com/',
|
||||
'[Rate limit exceeded] https://ratelimit-multi.com/',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -456,11 +456,9 @@ describe('WebFetchTool', () => {
|
||||
'[Warning] The following URLs were skipped:',
|
||||
);
|
||||
expect(result.llmContent).toContain(
|
||||
'[Private or Local Host] https://private.com/',
|
||||
);
|
||||
expect(result.llmContent).toContain(
|
||||
'[Private or Local Host] http://localhost',
|
||||
'[Blocked Host] https://private.com/',
|
||||
);
|
||||
expect(result.llmContent).toContain('[Blocked Host] http://localhost');
|
||||
});
|
||||
|
||||
it('should fallback to all public URLs if primary fails', async () => {
|
||||
|
||||
@@ -655,12 +655,12 @@ Response: ${truncateString(rawResponseText, 10000, '\n\n... [Error response trun
|
||||
this.config,
|
||||
new WebFetchFallbackAttemptEvent('private_ip_skipped'),
|
||||
);
|
||||
skipped.push(`[Private or Local Host] ${url}`);
|
||||
skipped.push(`[Blocked Host] ${url}`);
|
||||
continue;
|
||||
}
|
||||
if (!checkRateLimit(url).allowed) {
|
||||
debugLogger.warn(`[WebFetchTool] Rate limit exceeded for host: ${url}`);
|
||||
skipped.push(`[Rate Limit] ${url}`);
|
||||
skipped.push(`[Rate limit exceeded] ${url}`);
|
||||
continue;
|
||||
}
|
||||
toFetch.push(url);
|
||||
|
||||
Reference in New Issue
Block a user