mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 06:17:09 +00:00
feat(config): add proxy section to unified config loader
- merge proxy config with defaults in loadUnifiedConfig - preserve user overrides for remote/fallback/local sections
This commit is contained in:
@@ -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>): 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,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user