From 197174441f6eeca5e3c98e88af43d91ee081f734 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Fri, 19 Dec 2025 01:11:49 -0500 Subject: [PATCH] feat(config): add proxy section to unified config loader - merge proxy config with defaults in loadUnifiedConfig - preserve user overrides for remote/fallback/local sections --- src/config/unified-config-loader.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/config/unified-config-loader.ts b/src/config/unified-config-loader.ts index 80e0ad64..2450472a 100644 --- a/src/config/unified-config-loader.ts +++ b/src/config/unified-config-loader.ts @@ -16,6 +16,7 @@ import { UNIFIED_CONFIG_VERSION, DEFAULT_COPILOT_CONFIG, DEFAULT_GLOBAL_ENV, + DEFAULT_PROXY_CONFIG, GlobalEnvConfig, } from './unified-config-types'; import { isUnifiedConfigEnabled } from './feature-flags'; @@ -177,6 +178,24 @@ function mergeWithDefaults(partial: Partial): UnifiedConfig { enabled: partial.global_env?.enabled ?? true, env: partial.global_env?.env ?? { ...DEFAULT_GLOBAL_ENV }, }, + // Proxy config - remote/local CLIProxyAPI settings + proxy: { + remote: { + enabled: partial.proxy?.remote?.enabled ?? DEFAULT_PROXY_CONFIG.remote.enabled, + host: partial.proxy?.remote?.host ?? DEFAULT_PROXY_CONFIG.remote.host, + port: partial.proxy?.remote?.port ?? DEFAULT_PROXY_CONFIG.remote.port, + protocol: partial.proxy?.remote?.protocol ?? DEFAULT_PROXY_CONFIG.remote.protocol, + auth_token: partial.proxy?.remote?.auth_token ?? DEFAULT_PROXY_CONFIG.remote.auth_token, + }, + fallback: { + enabled: partial.proxy?.fallback?.enabled ?? DEFAULT_PROXY_CONFIG.fallback.enabled, + auto_start: partial.proxy?.fallback?.auto_start ?? DEFAULT_PROXY_CONFIG.fallback.auto_start, + }, + local: { + port: partial.proxy?.local?.port ?? DEFAULT_PROXY_CONFIG.local.port, + auto_start: partial.proxy?.local?.auto_start ?? DEFAULT_PROXY_CONFIG.local.auto_start, + }, + }, }; }