Enhance project documentation with identity updates and OpenClaw guidelines
- Add Chinese name and extended name origin in IDENTITY.md - Add OpenClaw documentation verification rules in MEMORY.md - Add BOOT.md for Gateway startup notification task spec - Initialize memory directory with daily notes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
119
memory/2026-03-14.md
Normal file
119
memory/2026-03-14.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# 2026-03-14 会话记录
|
||||
|
||||
## 犯错记录:OpenClaw BOOT.md 配置问题
|
||||
|
||||
### 错误 1:假设 hooks.enabled 就足够触发 BOOT.md
|
||||
|
||||
**时间**:18:31 - 18:55
|
||||
|
||||
**错误内容**:
|
||||
- 用户要求配置启动 hook 发送通知
|
||||
- 我建议创建 BOOT.md 并启用 `hooks.enabled: true`
|
||||
- 用户执行后重启 Gateway 卡住(实际是配置不完整)
|
||||
- 我只设置了 `hooks.enabled: true`,缺少必需的 `token` 和 `path` 字段
|
||||
|
||||
**正确做法**:
|
||||
- hooks 完整配置需要三个必需字段:`enabled`、`token`、`path`
|
||||
- 但即使配置完整,还需要启用 `boot-md` hook
|
||||
|
||||
**根本原因**:没有查阅官方文档,凭经验假设配置结构
|
||||
|
||||
---
|
||||
|
||||
### 错误 2:误判 Gateway"卡住"
|
||||
|
||||
**时间**:18:51 - 18:55
|
||||
|
||||
**错误内容**:
|
||||
- 用户说重启一直卡住
|
||||
- 我没有先检查 Gateway 状态,直接假设是配置问题
|
||||
- 实际 Gateway 已经正常运行(pid 3692212),只是重启过程较长(约 7 分钟)
|
||||
|
||||
**正确做法**:
|
||||
- 应该先执行 `openclaw gateway status` 和 `openclaw logs` 检查实际状态
|
||||
- 确认 Gateway 是否真的卡住还是已经完成启动
|
||||
|
||||
**根本原因**:没有先收集信息,直接基于用户描述做假设
|
||||
|
||||
---
|
||||
|
||||
### 错误 3:遗漏关键的 boot-md hook
|
||||
|
||||
**时间**:18:31 - 19:17(贯穿整个配置过程)
|
||||
|
||||
**错误内容**:
|
||||
- 全程没有提到需要启用 `boot-md` hook
|
||||
- 用户配置了 hooks 但 BOOT.md 仍然没有执行
|
||||
- 最后查阅官方文档才发现需要 `openclaw hooks enable boot-md`
|
||||
|
||||
**正确做法**:
|
||||
- 根据官方文档(/automation/hooks.md),BOOT.md 由 `boot-md` hook 触发
|
||||
- 必须执行 `openclaw hooks enable boot-md` 才会执行 BOOT.md
|
||||
- 这是 bundled hook,默认可能未启用
|
||||
|
||||
**根本原因**:
|
||||
1. 没有查阅官方文档
|
||||
2. 凭经验假设 `hooks.enabled` 就足够
|
||||
3. 不知道 OpenClaw 有 bundled hooks 系统
|
||||
|
||||
---
|
||||
|
||||
## 教训总结
|
||||
|
||||
### 核心问题
|
||||
**没有遵守"不清楚就查官方文档"的原则**
|
||||
|
||||
### 正确流程应该是
|
||||
1. 用户提出 OpenClaw 配置问题
|
||||
2. → 先查阅官方文档(/automation/hooks.md、/reference/templates/BOOT.md)
|
||||
3. → 找到完整的配置步骤和必需条件
|
||||
4. → 提供准确的配置命令
|
||||
5. → 验证配置是否生效
|
||||
|
||||
### 实际走的弯路
|
||||
1. 用户提问
|
||||
2. → 凭经验给出部分配置(缺少关键字段)
|
||||
3. → 用户执行失败
|
||||
4. → 逐步排查,多次尝试
|
||||
5. → 最后查阅官方文档找到正确答案
|
||||
6. → 配置成功
|
||||
|
||||
### 时间成本
|
||||
- **实际耗时**:约 45 分钟(18:31 - 19:17)
|
||||
- **如果先查文档**:可能只需 5-10 分钟
|
||||
|
||||
---
|
||||
|
||||
## 已采取的措施
|
||||
|
||||
1. ✅ 在 MEMORY.md 中添加工作规则:
|
||||
- OpenClaw 相关问题必须查阅官方文档
|
||||
- 不清楚时不得凭经验猜测
|
||||
- 优先使用 web_fetch 获取官方文档
|
||||
|
||||
2. ✅ 记录本次错误到短期记忆(本文件)
|
||||
|
||||
3. ✅ 配置完成并验证成功:
|
||||
- `hooks.enabled: true`
|
||||
- `hooks.token` 和 `hooks.path` 已设置
|
||||
- `boot-md` hook 已启用
|
||||
- BOOT.md 成功执行并发送飞书通知
|
||||
|
||||
---
|
||||
|
||||
## 相关命令记录
|
||||
|
||||
```bash
|
||||
# 完整配置流程(正确答案)
|
||||
openclaw config set hooks.enabled true
|
||||
openclaw config set hooks.token "boot-notification-token"
|
||||
openclaw config set hooks.path "/hooks"
|
||||
openclaw hooks enable boot-md
|
||||
openclaw gateway restart
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**记录时间**:2026-03-14 19:26 CST
|
||||
**会话 ID**:agent:main:main
|
||||
**用户**:开发者(彭强强)
|
||||
Reference in New Issue
Block a user