From b32220364eb3b023b6d62fd12a4cc4cd60da85e5 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sat, 20 Dec 2025 19:41:54 -0500 Subject: [PATCH] fix(config): add missing cliproxy_server section to YAML serialization The cliproxy_server config was being loaded and merged with defaults but never serialized to config.yaml. Added the missing section to generateYamlWithComments() so remote proxy settings persist correctly. Fixes save not persisting when configuring remote proxy settings in the Dashboard > Proxy tab. --- src/config/unified-config-loader.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/config/unified-config-loader.ts b/src/config/unified-config-loader.ts index 4189a994..ec2c4fab 100644 --- a/src/config/unified-config-loader.ts +++ b/src/config/unified-config-loader.ts @@ -374,6 +374,27 @@ function generateYamlWithComments(config: UnifiedConfig): string { lines.push(''); } + // CLIProxy Server section (remote proxy configuration) + if (config.cliproxy_server) { + lines.push('# ----------------------------------------------------------------------------'); + lines.push('# CLIProxy Server: Remote proxy connection settings'); + lines.push('# Configure via Dashboard (`ccs config`) > Proxy tab.'); + lines.push('#'); + lines.push('# remote: Connect to a remote CLIProxyAPI instance'); + lines.push('# fallback: Use local proxy if remote is unreachable'); + lines.push('# local: Local proxy settings (port, auto-start)'); + lines.push('# ----------------------------------------------------------------------------'); + lines.push( + yaml + .dump( + { cliproxy_server: config.cliproxy_server }, + { indent: 2, lineWidth: -1, quotingType: '"' } + ) + .trim() + ); + lines.push(''); + } + // Global env section if (config.global_env) { lines.push('# ----------------------------------------------------------------------------');