mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 12:15:57 +00:00
fix(cliproxy): filter undefined config values to preserve defaults
Object spread with {port: undefined} was overwriting DEFAULT_CONFIG.port,
causing "Using existing CLIProxy on port undefined" after upgrade.
Root cause: profileInfo.port is undefined for hardcoded CLIProxy profiles
(gemini, codex, agy, qwen). When passed to execClaudeWithCLIProxy(), the
undefined value replaced the default port 8317.
Fix: Filter out undefined values before merging with DEFAULT_CONFIG.
This commit is contained in:
@@ -121,7 +121,11 @@ export async function execClaudeWithCLIProxy(
|
||||
args: string[],
|
||||
config: Partial<ExecutorConfig> = {}
|
||||
): Promise<void> {
|
||||
const cfg = { ...DEFAULT_CONFIG, ...config };
|
||||
// Filter out undefined values to prevent overwriting defaults
|
||||
const filteredConfig = Object.fromEntries(
|
||||
Object.entries(config).filter(([, v]) => v !== undefined)
|
||||
) as Partial<ExecutorConfig>;
|
||||
const cfg = { ...DEFAULT_CONFIG, ...filteredConfig };
|
||||
const verbose = cfg.verbose || args.includes('--verbose') || args.includes('-v');
|
||||
|
||||
const log = (msg: string) => {
|
||||
|
||||
Reference in New Issue
Block a user