Files
knowledge-base/2 - Projects/OpenClaw/OpenClaw 部署配置分析.md
Yaojia Wang 61931d7b3d vault: add OpenClaw deployment analysis and agent configuration notes
- OpenClaw 部署配置分析: server info, channels, cron, known issues
- OpenClaw Agent 配置详情: multi-agent architecture, bindings, roles
2026-03-19 16:51:48 +01:00

169 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
created: "2026-03-19 17:00"
type: project
status: active
tags: [openclaw, ai-gateway, discord, homelab, deployment]
source: "ssh yiukai@192.168.68.108 ~/.openclaw/"
---
# OpenClaw 部署配置分析
## 服务器信息
| 项目 | 值 |
|------|-----|
| 主机 | `192.168.68.108` (yiukai-ubuntu) |
| 用户 | `yiukai` |
| OpenClaw 版本 | 2026.2.13 |
| 最新可用版本 | 2026.3.13 |
| Node.js 版本 | v18.19.1 (推荐 v22.16+ 或 v24) |
| 运行方式 | systemd user service (`openclaw-gateway.service`) |
| 运行时长 | 自 2026-03-15 起 |
| 内存占用 | ~633 MB |
| Gateway 端口 | 18789 |
| 绑定模式 | LAN |
| 认证方式 | Token |
| 配置文件 | `~/.openclaw/openclaw.json` |
## Agent 架构
### 默认配置
- **主模型**: `kimi-coding/k2p5` (Kimi Code)
- **备选模型**: `google-antigravity/claude-opus-4-6-thinking`
- **压缩模式**: safeguard
- **Agent 间通信**: 已启用 (ds-* 系列)
### Agent 列表
| ID | 名称 | 角色 | Discord 账户 | Workspace |
|----|------|------|-------------|-----------|
| `main` | (默认) | 通用 agent | - | `~/.openclaw/workspace` |
| `ds-commander` | 大统领 | 领导/协调 | commander | `workspace-ds-commander` |
| `ds-strategist` | 智库 | 策略/分析 | strategist | `workspace-ds-strategist` |
| `ds-builder` | 牛马 | 实施/构建 | builder | `workspace-ds-builder` |
| `ds-creator` | 作家 | 内容创作 | creator | `workspace-ds-creator` |
| `ds-guardian` | 大法官 | 监督/审查 | guardian | `workspace-ds-guardian` |
| `invest-analyst` | 投资分析师 | 投资分析 | invest-analyst | `workspace-invest-analyst` |
### Agent 间通信规则
`agentToAgent` 允许列表: ds-commander, ds-strategist, ds-builder, ds-creator, ds-guardian
invest-analyst 不在 agent-to-agent 通信列表中,独立运作。
## 渠道配置
### Discord
6 个 bot 账户,每个绑定一个 agent:
**主 Guild** (`1475225167423602841`):
- 5 个 ds-* bot全部 `requireMention: true`
- 所有 bot 共享同一频道 `1475225168635887776`
- 用户白名单: 你的账号 + 6 个 bot 互相可见
- streaming: off
**Stock Guild** (`1479926167141355560`):
- invest-analyst bot`requireMention: false`
- 频道 `1479926167736942774` (general)
- streaming: off
### Telegram
- 已启用
- DM 策略: pairing
- 群组策略: allowlist
- streaming: partial
## 定时任务 (Cron)
| 任务 | 调度 | Agent | 投递方式 |
|------|------|-------|----------|
| daily-invest-briefing | 工作日 08:00 (Stockholm) | invest-analyst | Discord channel:1479926167736942774 |
**任务内容**: 生成每日投资简报 -- 检查投资组合、分析宏观经济、汇总持仓新闻情绪、标记财报日期、给出买卖建议。
## Hooks
内部 hooks 已启用:
- `boot-md` -- 启动时加载 markdown
- `bootstrap-extra-files` -- 额外启动文件
- `command-logger` -- 命令日志
- `session-memory` -- 会话记忆
## Skills
| 技能 | 路径 |
|------|------|
| invest-api | `~/.openclaw/skills/invest-api` |
| openclaw-operator | `~/.openclaw/skills/openclaw-operator` |
## Plugins
| 插件 | 状态 |
|------|------|
| telegram | 已启用 |
| discord | 已启用 |
| google-antigravity-auth | 已启用 |
## Gateway 配置
- **控制 UI 允许来源**: localhost:18789, 127.0.0.1:18789, claw.colacoder.com
- **信任代理**: 192.168.68.70
- **Tailscale**: 关闭
- **禁用移动节点命令**: camera.snap, camera.clip, screen.record, calendar.add, contacts.add, reminders.add
## 已知问题
### 1. 版本过旧
- 当前: 2026.2.13
- 最新: 2026.3.13
- 建议: `openclaw update``npm install -g openclaw@latest`
### 2. Node.js 版本过低
- 当前: v18.19.1
- 推荐: v22.16+ LTS 或 v24
- 风险: 可能缺少新功能支持
### 3. Cron 投递失败
- `lastDeliveryStatus: "not-delivered"`
- Agent 执行成功 (`lastRunStatus: "ok"`),但消息未投递到 Discord
- 需要排查 Discord 频道权限或 bot 连接状态
### 4. invest-analyst 健康问题
- Health monitor 检测到 stuck 并自动重启
- 日志: `health-monitor: restarting (reason: stuck)`
- 可能原因: 模型响应超时、Discord 连接不稳定
### 5. 密钥管理
- Discord bot tokens 明文存储在 `openclaw.json`
- Kimi API key 在 `env` 字段中明文存储
- `.env` 文件存在但未完全迁移
- 建议: 将所有密钥迁移到环境变量
### 6. 遗留 Workspace
存在不再使用的 workspace 目录:
- `workspace-ds-lingce`
- `workspace-ds-linggong`
- `workspace-ds-linghe`
- `workspace-ds-lingwen`
- `workspace-ds-lingzong`
这些 agent 已不在配置中workspace 可以清理。
## 待办
- [ ] 升级 OpenClaw 到 2026.3.13
- [ ] 升级 Node.js 到 v22 LTS
- [ ] 排查 cron 投递失败问题
- [ ] 调查 invest-analyst stuck 原因
- [ ] 将密钥迁移到环境变量
- [ ] 清理遗留 workspace 目录
## Related
- [[OpenClaw-Skill-Reference]]
- [[OpenClaw Agent 配置详情]]
- [[家庭网络基础设施]]