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.
This commit is contained in:
kaitranntt
2025-12-20 19:41:54 -05:00
parent e0747f1e07
commit b32220364e
+21
View File
@@ -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('# ----------------------------------------------------------------------------');