mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-30 04:40:18 +08:00
紧急修复: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:
@@ -79,7 +79,10 @@ async function loadDashboardData(page) {
|
||||
// 自愈:补全关键默认值
|
||||
if (config) {
|
||||
let patched = false
|
||||
if (!config.mode) { config.mode = 'local'; patched = true }
|
||||
if (!config.gateway) config.gateway = {}
|
||||
if (!config.gateway.mode) { config.gateway.mode = 'local'; patched = true }
|
||||
// 修复旧版错误:mode 不应在顶层(OpenClaw 不认识)
|
||||
if (config.mode) { delete config.mode; patched = true }
|
||||
if (!config.tools || config.tools.profile !== 'full') {
|
||||
config.tools = { profile: 'full', sessions: { visibility: 'all' }, ...(config.tools || {}) }
|
||||
config.tools.profile = 'full'
|
||||
|
||||
@@ -326,8 +326,9 @@ function bindEvents(page, nodeOk) {
|
||||
const config = await api.readOpenclawConfig()
|
||||
if (config) {
|
||||
let patched = false
|
||||
if (!config.mode) {
|
||||
config.mode = 'local'
|
||||
if (!config.gateway) config.gateway = {}
|
||||
if (!config.gateway.mode) {
|
||||
config.gateway.mode = 'local'
|
||||
patched = true
|
||||
modal.appendLog('✅ 已设置 Gateway 运行模式为 local')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user