()
| 1018 | } |
| 1019 | |
| 1020 | private reloadRuntimeConfig(): KimiConfig { |
| 1021 | const loaded = loadRuntimeConfigSafe(this.configPath); |
| 1022 | if (loaded.fileWarnings.length > 0) { |
| 1023 | // Keep the last good config: adopting a salvaged config mid-run could |
| 1024 | // silently drop providers or models a live session depends on. |
| 1025 | this.configWarnings = [ |
| 1026 | ...loaded.fileWarnings, |
| 1027 | ...loaded.envWarnings, |
| 1028 | 'config.toml has errors; keeping the previously loaded configuration.', |
| 1029 | ]; |
| 1030 | log.warn('config reload degraded; keeping previous config', { |
| 1031 | warnings: loaded.fileWarnings, |
| 1032 | }); |
| 1033 | return this.config; |
| 1034 | } |
| 1035 | this.configWarnings = loaded.envWarnings; |
| 1036 | return this.setRuntimeConfig(loaded.config); |
| 1037 | } |
| 1038 | |
| 1039 | private setRuntimeConfig(config: KimiConfig): KimiConfig { |
| 1040 | this.config = config; |
no test coverage detected