紧急修复:mode 字段位置错误导致 Gateway 无法启动 (v0.4.6)

根因:openclaw.json 的 mode 属于 gateway 对象内部,不是顶层字段。
OpenClaw zod-schema 对顶层 mode 报 Unrecognized key 错误。

修复:
- config.rs init_openclaw_config: mode 移入 gateway 对象
- dev-api.js init_openclaw_config: 同上
- dashboard.js 自愈: config.mode → config.gateway.mode
- dashboard.js 自愈: 自动删除旧版错误的顶层 mode 字段
- setup.js 安装流程: config.mode → config.gateway.mode
This commit is contained in:
晴天
2026-03-05 23:41:55 +08:00
parent 8ba25a25e0
commit b4e959ec99
12 changed files with 175 additions and 39 deletions

View File

@@ -590,9 +590,9 @@ const handlers = {
const defaultConfig = {
"$schema": "https://openclaw.ai/schema/config.json",
meta: { lastTouchedVersion: "2026.1.1" },
mode: "local",
models: { providers: {} },
gateway: {
mode: "local",
port: 18789,
auth: { mode: "none" },
controlUi: { allowedOrigins: ["*"], allowInsecureAuth: true }