fix(openclaw): 兼容新版配置与 Node 门槛

This commit is contained in:
晴天
2026-06-11 15:24:01 +08:00
parent 5aa09f4bb7
commit 675ad1628b
33 changed files with 717 additions and 130 deletions

View File

@@ -86,6 +86,7 @@ const MEMORY_DEFAULTS = {
userCharLimit: 1375,
nudgeInterval: 10,
flushMinTurns: 6,
qmdRerank: true,
}
const SKILLS_DEFAULTS = {
@@ -185,6 +186,7 @@ const SECURITY_DEFAULTS = {
tirithPath: 'tirith',
tirithTimeout: 5,
tirithFailOpen: true,
installPolicyJson: '',
}
const DISPLAY_DEFAULTS = {
@@ -407,7 +409,7 @@ const TERMINAL_MODAL_MODES = ['auto', 'managed', 'direct']
const TERMINAL_VERCEL_RUNTIMES = ['node24', 'node22', 'python3.13']
const BROWSER_ENGINES = ['auto', 'lightpanda', 'chrome']
const BROWSER_DIALOG_POLICIES = ['must_respond', 'auto_dismiss', 'auto_accept']
const WEB_BACKENDS = ['', 'tavily', 'firecrawl', 'parallel', 'exa', 'searxng', 'brave', 'brave_free', 'ddgs', 'xai', 'native']
const WEB_BACKENDS = ['', 'tavily', 'firecrawl', 'parallel-free', 'parallel', 'exa', 'searxng', 'brave', 'brave_free', 'ddgs', 'xai', 'native']
const LSP_WAIT_MODES = ['document', 'full']
const LSP_INSTALL_STRATEGIES = ['auto', 'manual', 'off']
const STT_PROVIDERS = ['auto', 'local', 'groq', 'openai', 'mistral']
@@ -1115,6 +1117,10 @@ export function render() {
<input id="hm-memory-user-profile-enabled" type="checkbox" ${memoryValues.userProfileEnabled ? 'checked' : ''} ${disabled ? 'disabled' : ''}>
<span>${t('engine.hermesMemoryConfigUserProfileEnabled')}</span>
</label>
<label class="hm-channel-check">
<input id="hm-memory-qmd-rerank" type="checkbox" ${memoryValues.qmdRerank ? 'checked' : ''} ${disabled ? 'disabled' : ''}>
<span>${t('engine.hermesMemoryConfigQmdRerank')}</span>
</label>
</div>
<div class="hm-config-runtime-grid hm-config-memory-grid">
<label class="hm-field">
@@ -1722,6 +1728,10 @@ export function render() {
<input id="hm-security-tirith-timeout" class="hm-input" type="number" inputmode="numeric" min="1" max="300" step="1" value="${esc(securityValues.tirithTimeout)}" ${disabled ? 'disabled' : ''}>
</label>
</div>
<label class="hm-field" style="margin-top:14px">
<span class="hm-field-label">${t('engine.hermesSecurityConfigInstallPolicyJson')}</span>
<textarea id="hm-security-install-policy-json" class="hm-input" spellcheck="false" rows="8" ${disabled ? 'disabled' : ''} style="font-family:var(--hm-font-mono);line-height:1.65;min-height:220px">${esc(securityValues.installPolicyJson)}</textarea>
</label>
<div class="hm-channel-footnote">${t('engine.hermesSecurityConfigFootnote')}</div>
</div>
</div>
@@ -4071,6 +4081,7 @@ export function render() {
userCharLimit: el.querySelector('#hm-memory-user-char-limit')?.value || '1375',
nudgeInterval: el.querySelector('#hm-memory-nudge-interval')?.value || '10',
flushMinTurns: el.querySelector('#hm-memory-flush-min-turns')?.value || '6',
qmdRerank: !!el.querySelector('#hm-memory-qmd-rerank')?.checked,
}
memorySaving = true
memoryError = null
@@ -4506,6 +4517,7 @@ export function render() {
tirithPath: el.querySelector('#hm-security-tirith-path')?.value || 'tirith',
tirithTimeout: el.querySelector('#hm-security-tirith-timeout')?.value || '5',
tirithFailOpen: !!el.querySelector('#hm-security-tirith-fail-open')?.checked,
installPolicyJson: el.querySelector('#hm-security-install-policy-json')?.value || '',
}
securitySaving = true
securityError = null

View File

@@ -67,7 +67,7 @@ OpenClaw 是开源个人 AI 助手平台,核心组件:
| \`openclaw channels login\` | 登录渠道(如 WhatsApp QR |
| \`openclaw pairing list <channel>\` | 列出配对请求 |
| \`openclaw pairing approve <channel> <code>\` | 批准配对 |
| \`openclaw configure --section web\` | 配置 Web 搜索Brave API |
| \`openclaw configure --section web\` | 配置 Web 搜索Brave / Parallel 等 |
| \`openclaw config set <key> <value>\` | 设置单个配置项 |
| \`openclaw logs\` | 查看日志 |
| \`openclaw service start/stop/restart\` | 管理后台服务 |
@@ -77,6 +77,13 @@ OpenClaw 是开源个人 AI 助手平台,核心组件:
配置位于 \`~/.openclaw/openclaw.json\`JSON5 格式(支持注释和尾逗号)。
不存在时使用安全默认值。严格 schema 验证,未知键会阻止启动。
### Web 搜索插件
- Parallel Web Search 插件 id 为 \`parallel\`,目录为 \`extensions/parallel\`
- 免费候选 provider 为 \`parallel-free\`;正式 Parallel Search provider 为 \`parallel\`
- API Key 环境变量:\`PARALLEL_API_KEY\`
- 配置路径:\`plugins.entries.parallel.config.webSearch.apiKey\` / \`plugins.entries.parallel.config.webSearch.baseUrl\`
- QMD 查询重排序开关:\`memory.qmd.rerank\`
### 最小配置示例
\`\`\`json5
{
@@ -185,7 +192,7 @@ iwr -useb https://openclaw.ai/install.ps1 | iex
\`\`\`bash
npm install -g openclaw@latest
\`\`\`
**前置条件:** Node.js >= 22
**前置条件:** Node.js >= 22.19.0
## 九、后台服务
- **macOS**launchd 服务openclaw 应用管理)

View File

@@ -738,6 +738,7 @@ export default {
hermesWebConfigBackend_auto: _('自动选择', 'Auto select', '自動選擇'),
hermesWebConfigBackend_tavily: _('Tavily', 'Tavily', 'Tavily'),
hermesWebConfigBackend_firecrawl: _('Firecrawl', 'Firecrawl', 'Firecrawl'),
'hermesWebConfigBackend_parallel-free': _('Parallel Free免 Key', 'Parallel Free (no key)', 'Parallel Free免 Key'),
hermesWebConfigBackend_parallel: _('Parallel', 'Parallel', 'Parallel'),
hermesWebConfigBackend_exa: _('Exa', 'Exa', 'Exa'),
hermesWebConfigBackend_searxng: _('SearXNG', 'SearXNG', 'SearXNG'),
@@ -982,7 +983,8 @@ export default {
hermesMemoryConfigUserCharLimit: _('用户画像字符上限', 'User profile character limit', '使用者画像字元上限'),
hermesMemoryConfigNudgeInterval: _('整理提醒间隔', 'Review nudge interval', '整理提醒間隔'),
hermesMemoryConfigFlushMinTurns: _('退出/重置前最少轮数', 'Minimum turns before flush', '退出/重置前最少輪數'),
hermesMemoryConfigFootnote: _('提醒间隔按用户消息轮数计算,设为 0 可关闭提醒。flush 最小轮数会影响退出、重置和压缩前是否先写入记忆。外部记忆 provider 等高级字段会保留在 raw YAML 中。', 'The nudge interval is counted in user turns. Set it to 0 to disable nudges. flush minimum turns controls whether memory is written before exit, reset, or compression. Advanced fields such as external memory provider are preserved in raw YAML.', '提醒間隔依使用者訊息輪數計算,設為 0 可關閉提醒。flush 最小輪數會影響退出、重置和壓縮前是否先寫入記憶。外部記憶 provider 等進階欄位會保留在 raw YAML 中。'),
hermesMemoryConfigQmdRerank: _('QMD 查询重排序', 'QMD query rerank', 'QMD 查詢重排序'),
hermesMemoryConfigFootnote: _('提醒间隔按用户消息轮数计算,设为 0 可关闭提醒。QMD 查询重排序写入 memory.qmd.rerank关闭后可在 query 模式下减少延迟。外部记忆 provider 等高级字段会保留在 raw YAML 中。', 'The nudge interval is counted in user turns. Set it to 0 to disable nudges. QMD query rerank writes memory.qmd.rerank; turning it off can reduce latency in query mode. Advanced fields such as external memory provider are preserved in raw YAML.', '提醒間隔依使用者訊息輪數計算,設為 0 可關閉提醒。QMD 查詢重排序寫入 memory.qmd.rerank關閉後可在 query 模式下降低延遲。外部記憶 provider 等進階欄位會保留在 raw YAML 中。'),
hermesSkillsConfigTitle: _('技能沉淀', 'Skill capture', '技能沉澱'),
hermesSkillsConfigDesc: _('控制 Hermes 何时提醒把可复用经验沉淀为 Skills并指定可共享的外部技能目录。适合长跑任务和团队复用。', 'Control when Hermes nudges users to turn reusable experience into Skills and which external skill directories are shared. Useful for long-running work and team reuse.', '控制 Hermes 何時提醒把可重複使用經驗沉澱為 Skills並指定可共享的外部技能目錄。適合長跑任務和團隊複用。'),
hermesSkillsConfigStatusReady: _('结构化配置', 'structured settings', '結構化設定'),
@@ -1262,7 +1264,8 @@ export default {
hermesSecurityConfigTirithPath: _('Tirith 可执行文件路径', 'Tirith executable path', 'Tirith 可執行檔路徑'),
hermesSecurityConfigTirithTimeout: _('扫描超时(秒)', 'Scan timeout (s)', '掃描逾時(秒)'),
hermesSecurityConfigTirithFailOpen: _('Tirith 不可用时放行', 'Allow when Tirith is unavailable', 'Tirith 不可用時放行'),
hermesSecurityConfigFootnote: _('启用后Hermes 会在终端命令执行前调用 Tirith 进行内容级安全扫描Tirith 不可用时是否放行取决于 fail-open。Windows 平台通常会静默跳过 Tirith真实执行能力仍受宿主环境影响。', 'When enabled, Hermes runs Tirith before terminal commands for content-level scanning. Whether commands pass when Tirith is unavailable depends on fail-open. On Windows, Tirith is usually skipped silently, and actual execution still depends on the host environment.', '啟用後Hermes 會在終端命令執行前呼叫 Tirith 進行內容級安全掃描Tirith 不可用時是否放行取決於 fail-open。Windows 平台通常會靜默跳過 Tirith真實執行能力仍受主機環境影響。'),
hermesSecurityConfigInstallPolicyJson: _('Install Policy JSON', 'Install Policy JSON', 'Install Policy JSON'),
hermesSecurityConfigFootnote: _('启用后Hermes 会在终端命令执行前调用 Tirith 进行内容级安全扫描Install Policy 写入 security.installPolicy空白会删除该覆盖。其他 security 高级字段会保留在 raw YAML 中。', 'When enabled, Hermes runs Tirith before terminal commands for content-level scanning. Install Policy writes security.installPolicy; leaving it blank removes that override. Other advanced security fields stay in raw YAML.', '啟用後Hermes 會在終端命令執行前呼叫 Tirith 進行內容級安全掃描Install Policy 寫入 security.installPolicy空白會刪除該覆蓋。其他 security 進階欄位會保留在 raw YAML 中。'),
// Batch 1 §E: 会话导出
sessionsExport: _('导出', 'Export', '匯出'),
sessionsExportSuccess: _('已导出', 'Exported', '已匯出'),

View File

@@ -128,10 +128,10 @@ export default {
promptNodeUnsupported: _('Node.js 版本过低: 当前 {version},要求 {required}', 'Node.js version is too old: current {version}, required {required}', 'Node.js 版本過低:目前 {version},要求 {required}'),
nodeUpgradeHint: _('当前 Node.js {version} 版本过低OpenClaw 要求 {required}。请先升级 Node.js否则 Gateway 无法启动。', 'Current Node.js {version} is too old; OpenClaw requires {required}. Upgrade Node.js first or Gateway cannot start.', '目前 Node.js {version} 版本過低OpenClaw 要求 {required}。請先升級 Node.js否則 Gateway 無法啟動。'),
nodeUnsupportedTitle: _('已检测到 Node.js但版本不满足要求', 'Node.js was detected, but the version is not supported', '已檢測到 Node.js但版本不符合要求'),
winNodeUpgradeHint: _('Windows 可尝试一键升级;如果失败,请手动安装 Node.js 22.19.0 或更高版本。升级后点击「重新检测」。', 'On Windows, try one-click upgrade. If it fails, manually install Node.js 22.19.0 or newer. Click "Re-detect" after upgrading.', 'Windows 可嘗試一鍵升級;如果失敗,請手動安裝 Node.js 22.19.0 或更高版本。升級後點擊「重新檢測」。'),
macNodeUpgradeHint: _('macOS 请通过官网、Homebrew、nvm 或 fnm 升级 Node.js 22.19.0 或更高版本。升级后建议重启 ClawPanel如果从 Finder 启动仍检测到旧版本,可从终端重新打开:', 'On macOS, upgrade Node.js to 22.19.0 or newer via the official installer, Homebrew, nvm, or fnm. Restart ClawPanel after upgrading; if Finder still detects the old version, reopen it from Terminal:', 'macOS 請透過官網、Homebrew、nvm 或 fnm 升級 Node.js 22.19.0 或更高版本。升級後建議重啟 ClawPanel如果從 Finder 啟動仍檢測到舊版本,可從終端重新開啟:'),
linuxNodeUpgradeHint: _('Linux 请使用系统包管理器、NodeSource、nvm 或 fnm 升级 Node.js 22.19.0 或更高版本。升级后点击「重新检测」,必要时重启 ClawPanel Web/桌面进程。', 'On Linux, upgrade Node.js to 22.19.0 or newer using your package manager, NodeSource, nvm, or fnm. Click "Re-detect" after upgrading, and restart the ClawPanel Web/desktop process if needed.', 'Linux 請使用系統套件管理器、NodeSource、nvm 或 fnm 升級 Node.js 22.19.0 或更高版本。升級後點擊「重新檢測」,必要時重啟 ClawPanel Web/桌面進程。'),
genericNodeUpgradeHint: _('请升级 Node.js 22.19.0 或更高版本,升级后点击「重新检测」。如果仍检测到旧版本,请检查 PATH 优先级或重启 ClawPanel。', 'Upgrade Node.js to 22.19.0 or newer, then click "Re-detect". If the old version is still detected, check PATH priority or restart ClawPanel.', '請升級 Node.js 22.19.0 或更高版本,升級後點擊「重新檢測」。如果仍檢測到舊版本,請檢查 PATH 優先級或重啟 ClawPanel。'),
winNodeUpgradeHint: _('Windows 可尝试一键升级;如果失败,请手动安装满足当前 OpenClaw 要求的 Node.js。升级后点击「重新检测」。', 'On Windows, try one-click upgrade. If it fails, manually install a Node.js version that satisfies the current OpenClaw requirement. Click "Re-detect" after upgrading.', 'Windows 可嘗試一鍵升級;如果失敗,請手動安裝滿足目前 OpenClaw 要求的 Node.js。升級後點擊「重新檢測」。'),
macNodeUpgradeHint: _('macOS 请通过官网、Homebrew、nvm 或 fnm 升级到满足当前 OpenClaw 要求的 Node.js。升级后建议重启 ClawPanel如果从 Finder 启动仍检测到旧版本,可从终端重新打开:', 'On macOS, upgrade Node.js to a version that satisfies the current OpenClaw requirement via the official installer, Homebrew, nvm, or fnm. Restart ClawPanel after upgrading; if Finder still detects the old version, reopen it from Terminal:', 'macOS 請透過官網、Homebrew、nvm 或 fnm 升級到滿足目前 OpenClaw 要求的 Node.js。升級後建議重啟 ClawPanel如果從 Finder 啟動仍檢測到舊版本,可從終端重新開啟:'),
linuxNodeUpgradeHint: _('Linux 请使用系统包管理器、NodeSource、nvm 或 fnm 升级到满足当前 OpenClaw 要求的 Node.js。升级后点击「重新检测」,必要时重启 ClawPanel Web/桌面进程。', 'On Linux, upgrade Node.js to a version that satisfies the current OpenClaw requirement using your package manager, NodeSource, nvm, or fnm. Click "Re-detect" after upgrading, and restart the ClawPanel Web/desktop process if needed.', 'Linux 請使用系統套件管理器、NodeSource、nvm 或 fnm 升級到滿足目前 OpenClaw 要求的 Node.js。升級後點擊「重新檢測」,必要時重啟 ClawPanel Web/桌面進程。'),
genericNodeUpgradeHint: _('请升级到满足当前 OpenClaw 要求的 Node.js,升级后点击「重新检测」。如果仍检测到旧版本,请检查 PATH 优先级或重启 ClawPanel。', 'Upgrade Node.js to a version that satisfies the current OpenClaw requirement, then click "Re-detect". If the old version is still detected, check PATH priority or restart ClawPanel.', '請升級到滿足目前 OpenClaw 要求的 Node.js,升級後點擊「重新檢測」。如果仍檢測到舊版本,請檢查 PATH 優先級或重啟 ClawPanel。'),
autoUpgradeNodeBtn: _('一键升级 Node.js', 'Upgrade Node.js', '一鍵升級 Node.js'),
upgradingNode: _('升级中...', 'Upgrading...', '升級中...'),
downloadLatestNode: _('下载新版 Node.js', 'Download latest Node.js', '下載新版 Node.js'),
@@ -151,7 +151,7 @@ export default {
nodeUpgradeStarting: _('开始检查 Windows winget 和 Node.js LTS 安装状态...', 'Checking Windows winget and Node.js LTS install state...', '開始檢查 Windows winget 和 Node.js LTS 安裝狀態...'),
nodeUpgradeRedetecting: _('已触发重新检测;如果仍显示旧版本,请重启 ClawPanel 或检查 PATH 优先级。', 'Re-detecting now. If the old version still appears, restart ClawPanel or check PATH priority.', '已觸發重新檢測;如果仍顯示舊版本,請重啟 ClawPanel 或檢查 PATH 優先級。'),
nodeUpgradeStartGatewayHint: _('检测通过后,回到仪表盘或服务页启动 Gateway。', 'After the check passes, return to Dashboard or Services and start Gateway.', '檢測通過後,回到儀表盤或服務頁啟動 Gateway。'),
nodeManualInstallHint: _('请手动安装 Node.js 22.19.0 或更高版本', 'Please manually install Node.js 22.19.0 or newer:', '請手動安裝 Node.js 22.19.0 或更高版本'),
nodeManualInstallHint: _('请手动安装满足当前 OpenClaw 要求的 Node.js', 'Please manually install a Node.js version that satisfies the current OpenClaw requirement:', '請手動安裝滿足目前 OpenClaw 要求的 Node.js'),
nodeUpgradeRestartHint: _('安装后回到 ClawPanel 点击「重新检测」。如果仍检测到旧版本,重启 ClawPanel 或把新版 Node.js 路径放到 PATH 更靠前的位置。', 'After installing, return to ClawPanel and click "Re-detect". If the old version is still detected, restart ClawPanel or move the newer Node.js path earlier in PATH.', '安裝後回到 ClawPanel 點擊「重新檢測」。如果仍檢測到舊版本,請重啟 ClawPanel 或把新版 Node.js 路徑放到 PATH 更靠前的位置。'),
promptGitMissing: _('Git 未安装', 'Git not installed', 'Git 未安裝'),
promptGitOk: _('Git 已安装: {version}', 'Git installed: {version}', 'Git 已安裝: {version}'),

View File

@@ -786,7 +786,7 @@ const BUILTIN_SKILLS = [
具体操作:
1. 调用 get_system_info 获取 OS、架构、Node.js 版本等基础信息
2. 用 run_command 检查 Node.js 版本node -v要求 >= 18
2. 用 run_command 检查 Node.js 版本node -v并按当前 OpenClaw 的 engines.node 判断是否兼容
3. 用 run_command 检查 npm 版本npm -v
4. 用 run_command 检查 OpenClaw CLIopenclaw --version
5. 用 check_port 检查 Gateway 端口 18789