fix: always overwrite api_server config on startup
Simplify ensureApiServerConfig to unconditionally write default platforms.api_server values, preventing missing config issues. Bump version to 0.2.7. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hermes-web-ui",
|
||||
"version": "0.2.6",
|
||||
"version": "0.2.7",
|
||||
"description": "Web dashboard for Hermes Agent — multi-platform AI chat, session management, scheduled jobs, usage analytics & channel configuration (Telegram, Discord, Slack, WhatsApp)",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -184,17 +184,7 @@ async function ensureApiServerConfig() {
|
||||
if (!cfg.platforms) cfg.platforms = {}
|
||||
if (!cfg.platforms.api_server) cfg.platforms.api_server = {}
|
||||
|
||||
const api = cfg.platforms.api_server
|
||||
let changed = false
|
||||
|
||||
for (const [k, v] of Object.entries(defaults)) {
|
||||
if (api[k] != null && api[k] !== v) {
|
||||
api[k] = v
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
|
||||
if (!changed) return
|
||||
cfg.platforms.api_server = defaults
|
||||
|
||||
copyFileSync(configPath, configPath + '.bak')
|
||||
writeFileSync(configPath, yaml.dump(cfg), 'utf-8')
|
||||
|
||||
Reference in New Issue
Block a user