refactor(core): improve error handling for setGlobalProxy (#12437)

This commit is contained in:
Allen Hutchison
2025-11-03 10:13:52 -08:00
committed by GitHub
parent 19ea68b838
commit 9d642f3bb1
4 changed files with 85 additions and 16 deletions

View File

@@ -21,11 +21,7 @@ import { getErrorMessage } from '../utils/errors.js';
import type { Config } from '../config/config.js';
import { ApprovalMode, DEFAULT_GEMINI_FLASH_MODEL } from '../config/config.js';
import { getResponseText } from '../utils/partUtils.js';
import {
fetchWithTimeout,
isPrivateIp,
setGlobalProxy,
} from '../utils/fetch.js';
import { fetchWithTimeout, isPrivateIp } from '../utils/fetch.js';
import { convert } from 'html-to-text';
import {
logWebFetchFallbackAttempt,
@@ -415,10 +411,6 @@ export class WebFetchTool extends BaseDeclarativeTool<
false, // canUpdateOutput
messageBus,
);
const proxy = config.getProxy();
if (proxy) {
setGlobalProxy(proxy);
}
}
protected override validateToolParamValues(