fix proxy normalization

This commit is contained in:
DennisYu07 2026-03-30 14:37:18 +08:00
parent 980604bccd
commit bba3ab93b1
4 changed files with 122 additions and 2 deletions

View file

@ -108,6 +108,7 @@ import { shouldDefaultToNodePty } from '../utils/shell-utils.js';
import { WorkspaceContext } from '../utils/workspaceContext.js';
import { type ToolName } from '../utils/tool-utils.js';
import { getErrorMessage } from '../utils/errors.js';
import { normalizeProxyUrl } from '../utils/proxyUtils.js';
// Local config modules
import type { FileFilteringOptions } from './constants.js';
@ -747,8 +748,9 @@ export class Config {
initializeTelemetry(this);
}
if (this.getProxy()) {
setGlobalDispatcher(new ProxyAgent(this.getProxy() as string));
const normalizedProxy = normalizeProxyUrl(this.getProxy());
if (normalizedProxy) {
setGlobalDispatcher(new ProxyAgent(normalizedProxy));
}
this.geminiClient = new GeminiClient(this);
this.chatRecordingService = this.chatRecordingEnabled