OpenClaw (PC Instance)
Instance
- Running on: DESKTOP-F9KSPPP (Windows)
- Path:
C:\Users\Sozo\AppData\Roaming\npm\node_modules\openclaw\ - Startup:
Start-Process node.exe -ArgumentList '--stack-size=4096', 'openclaw.mjs', 'gateway', '--port', '18789' - Web UI: http://localhost:18789
- Gateway: port 18791
Config File
D:\OpenClaw_Home\.openclaw\openclaw.json
Default Model
deepseek/deepseek-v4-flash (直连, 非 OpenRouter, 2026-06-09 切换; minimax 降级为 fallback#1)
Model Provider Stack (2026-06-09 update — Telegram session 20260609_083838_42294b4e)
状态: 根因已找到 + 修复已应用 (user 改 “deepseek 直连因为好像比较便宜”); 价格对比验证仍 mid-Q&A (助手在 08:55 暂停核对官方价 vs minimax 账单)
触发原因
之前 OpenClaw primary = openrouter/deepseek/deepseek-v4-flash (走 OpenRouter 中转). user 在 Telegram 说 “改成 deepseek 直连因为好像比较便宜”, 助手在同一个 session 内完成了切换.
当前 providers 配置 (D:\OpenClaw_Home.openclaw\openclaw.json)
{
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com/v1",
"api": "openai-completions",
"apiKey": {
"source": "env",
"provider": "default",
"id": "DEEPSEEK_API_KEY" // SecretRef — 实际值不在 JSON 里
}
},
"minimax": { /* 保留为 fallback#1, api 同样 openai-completions */ }
}
}三个模型实测 (openclaw models list 输出)
deepseek/deepseek-v4-flash text 1024k default,configured,alias:DSFlash
minimax/MiniMax-M2.7 text 200k fallback#1
deepseek/deepseek-v4-pro text 1024k configured,alias:DSPro
Gateway 升级
- 旧版: OpenClaw (Gemini 4 时代, build 不详)
- 新版: OpenClaw 2026.6.1 (2e08f0f)
- npm install: added 21 packages, removed 277 packages (依赖重整)
- health-monitor.ps1 有 auto-repair (kill + restart) → 升级时不用手动管 gateway
备份 (改动前快照)
C:\Users\IDA\.openclaw\openclaw.json.pre-gemini4-20260609-…— 切换前的 Gemini 4 配置, 完整保留
Key 安全
- DEEPSEEK_API_KEY 存哪里: 走
SecretRef→ 环境变量DEEPSEEK_API_KEY(在 IDA PC 的~/.hermes/.env或 Sozo PC 的对应位置, 需 user 确认哪个) - openclaw.json 里只看到
__OPENCLAW_REDACTED__placeholder, 真 key 不在 JSON - 注意: 这跟 desktop-app-启-backend-用哪个-env-—-两个独立-hermes-部署-2026-06-07-1330 里
%LOCALAPPDATA%\hermes\.env写 key 是两套独立方案 — OpenClaw 走 env var + SecretRef, Hermes Desktop 走 plaintext .env
Defer (等 user 完成价格对比)
- 助手 08:55 暂停在 “官方 DeepSeek 价 vs minimax 账单” 对比 → 价格是否真的更便宜, 需要拿实际账单才算数
- 如果 user 回话: “账单出来了, 直连确实便宜” → 标记本次切换 = 确认有效, 加进 decision-log
- 如果 user 回话: “其实差不多” → 触发”是否切回 OpenRouter” 的 A/B/C
- 如果 user 不回: 默认保留当前直连配置, 不主动回退
Related
- decision-log (2026-04-15 旧决策 “OpenClaw primary = openrouter/…”; 待加 2026-06-09 的 supersede 决策)
- hermes-agent (Hermes Desktop 的 DEEPSEEK_API_KEY 修复是另一个子系统, 不要混淆)
- sozo-setup (OpenClaw 跑在 Sozo PC, 配置在 D:\OpenClaw_Home)
Telegram Bot
- Bot: @JakeyBiluBot
- Token:
8766595133:AAH...iqN_BpP...(partial — full token in PC config) - Status: Gateway running, but Telegram polling FAILS (see below)
CRITICAL BUG: Node.js 24 Telegram Fetch Timeout (2026-05-05)
Symptom
- OpenClaw gateway starts successfully on port 18789
- Telegram plugin fails to poll:
fetch timeout reached; aborting operation fetchWithTimeouttoapi.telegram.org/bot.../getMetimes out after 38600ms- Subsequent
setMyCommandsalso fails with network error - BUT: curl.exe on the same PC CAN reach Telegram API instantly
Root Cause
Node.js 24’s native fetch (used by Grammy library) cannot reach Telegram API from this PC. Curl works fine. This is a Node.js-specific network issue — possibly related to:
- TLS/SSL stack difference between Node.js fetch and Windows system TLS
- Node.js 24 (unreleased/beta) network behavior on Windows
- Antivirus/firewall selectively blocking Node.js HTTPS connections
Event Loop Issue
Log also shows severe event loop starvation when Telegram fetch hangs:
- 34 seconds delay
- 93% event loop utilization
- This blocks all other operations during the 38s timeout
Workaround
- Direct Telegram API calls via
curlfrom PC work fine - Bot can send messages via API even though polling fails
- User receives messages from Termux Hermes bot, not OpenClaw bot
Investigation Tried
-e "TRACE RESOLUTION"Node flag — no additional info--tls-max=<version>flag attempt- Different Telegram API methods all fail (getMe, setMyCommands)
- All fail at network level, not Telegram API level
Known Working Startup (2026-05-05 22:34)
# Kill existing
ssh [email protected] "taskkill /F /PID <PID>"
# Start via PowerShell Start-Process with output redirection
ssh [email protected] "powershell -NoProfile -Command \
'Start-Process -FilePath \"C:\Program Files\nodejs\node.exe\" \
-ArgumentList \"--stack-size=4096\",\"C:\Users\Sozo\AppData\Roaming\npm\node_modules\openclaw\openclaw.mjs\",\"gateway\",\"--port\",\"18789\" \
-RedirectStandardOutput \"C:\Users\Sozo\AppData\Local\Temp\openclaw\stdout.log\" \
-RedirectStandardError \"C:\Users\Sozo\AppData\Local\Temp\openclaw\stderr.log\"'"
# Verify after 15s
ssh [email protected] "netstat -ano | findstr 18789"Lock File Issue
- Location:
C:\Users\Sozo\AppData\Roaming\npm\node_modules\openclaw\state\lock - Delete before starting if “already running” error
- Sometimes need to delete twice
Memory Index Corruption Fix (2026-05-06)
Symptom
- OpenClaw semantic memory index becomes corrupted
- Residual
main.sqlite.tmp-*files accumulate in memory directory - This causes memory/index functionality to fail or behave incorrectly
Fix Procedure
- Stop the gateway:
# Find and kill gateway process Get-Process node -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '*openclaw*' } Stop-Process -Id <PID> -Force - Delete tmp files:
Remove-Item "$env:OPENCLAW_HOME\.openclaw\memory\main.sqlite.tmp-*" -Force - Rebuild semantic index:
openclaw memory index --force - Restart gateway (see Known Working Startup above)
npm Corruption Fix (2026-05-14)
Symptom
- OpenClaw fails to start with
backoff-OFL2Aish.jsmodule not found dist/folder missing critical files
Fix
# Full reinstall of OpenClaw npm package
npm install -g openclawBackground Crash Issue (2026-05-13)
Observation
Claude Code (also MiniMax 2.7, local PC) does NOT crash during intensive work. OpenClaw crashes frequently on the same PC, same model. This suggests the issue is not the model but the OpenClaw/Node.js environment.
Symptoms
- OpenClaw gateway crashes while Claude Code stays stable
- Both use MiniMax 2.7 via OpenRouter on the same Windows PC
- Crash causes loss of task context/recall — significant recovery overhead
UTF-8 BOM Config Bug (2026-05-14)
Symptom
- OpenClaw gateway shows bot token as
8766595133:***(PowerShell masking) - Telegram returns 401 Unauthorized even with correct token
JSON.parsesilently fails to read config due to BOM
Root Cause
openclaw.jsonhas UTF-8 BOM (EF BB BF) at start of file- Node.js
JSON.parsecannot read files with BOM — treats BOM as invalid character - Config appears to load but critical fields are unreadable
Fix
# Remove UTF-8 BOM from openclaw.json
$bom = [byte[]](0xEF, 0xBB, 0xBF)
$content = [System.IO.File]::ReadAllBytes("D:\OpenClaw_Home\.openclaw\openclaw.json")
if ($content[0..2] -join "," -eq "239,187,191") {
$clean = $content[3..($content.Length-1)]
[System.IO.File]::WriteAllBytes("D:\OpenClaw_Home\.openclaw\openclaw.json", $clean)
Write-Host "BOM removed"
}Verification
# Check first 4 bytes — should be 7B 0D 0A 20 ({ \r \n space), NOT EF BB BF
[System.IO.File]::ReadAllBytes("D:\OpenClaw_Home\.openclaw\openclaw.json")[0..3] -join " "Connection
- SSH:
ssh [email protected] - SSH alternative:
ssh [email protected]