@uncaged/openclaw-plugin-ograph
v0.1.2
Published
OGraph Channel Plugin — Agent Session dispatcher for OGraph events
Downloads
394
Readme
OpenClaw OGraph Plugin
OGraph 事件分发插件,将 OGraph 事件路由到基于主题的 Agent 会话中。
架构
Dispatcher (感知层) → Plugin (调度层) → Agent (执行层)- Dispatcher: 轮询 OGraph 事件流,发现新事件后 POST 到 Plugin
- Plugin: 接收事件,按 topic 分组,去重合并,调用 Agent session
- Agent: 处理具体任务逻辑
快速安装
1. 克隆并构建
git clone https://github.com/oc-xiaoju/openclaw-plugin-ograph.git
cd openclaw-plugin-ograph
npm install --ignore-scripts && npm run build⚠️ 重要:使用 --ignore-scripts 避免权限问题
某些系统上 npm install 可能遇到 EPERM 错误。使用 --ignore-scripts 跳过 post-install 脚本可以避免此问题。这不会影响插件功能,因为我们手动运行 npm run build。
2. 注册到 OpenClaw
编辑 ~/.openclaw/openclaw.json,添加:
{
"plugins": {
"allow": ["ograph"],
"load": {
"paths": ["/absolute/path/to/openclaw-plugin-ograph"]
},
"entries": {
"ograph": {
"enabled": true,
"config": {
"secret": "your-gateway-token-here",
"topics": {
"task-execution": {
"description": "任务执行管理",
"debounceMs": 5000,
"systemPrompt": "你是 OGraph 任务执行管理器..."
}
}
}
}
}
}
}🔑 认证说明:
config.secret应填入你的 OpenClaw Gateway Token- 获取方法:在
~/.openclaw/openclaw.json中找到gateway.auth.token的值 - 这个 token 用于 Dispatcher → Plugin 的 HTTP 认证
3. 重启 Gateway
openclaw gateway restart4. 验证安装
# 应该返回 401 Unauthorized(说明端点存在但缺少认证)
curl -X POST http://localhost:18789/plugins/ograph/dispatch \\
-H "Content-Type: application/json" -d '{}'API 端点
POST /plugins/ograph/dispatch- 接收事件(需要 gateway 认证)POST /plugins/ograph/flush- 强制刷新所有 ready topicsGET /plugins/ograph/status- 查看插件状态
配置选项
Topics
每个 topic 对应一个 Agent session:
{
"topics": {
"task-execution": {
"description": "任务执行管理",
"debounceMs": 5000,
"systemPrompt": "你是任务管理器..."
},
"code-review": {
"description": "代码审查",
"debounceMs": 2000,
"systemPrompt": "你是代码审查专家..."
}
}
}配置说明
debounceMs: 事件合并等待时间(毫秒)systemPrompt: Agent 会话的系统提示词- Plugin 会为每个 topic 创建独立的 session key:
agent:main:ograph:default:direct:{topic}
故障排除
| 问题 | 解决方法 |
|------|----------|
| Plugin 返回 404 | 检查 plugins.allow 包含 "ograph" 且 load.paths 路径正确 |
| Dispatcher 连接失败 | 确保 config.secret 使用正确的 Gateway Token |
| npm install EPERM | 使用 npm install --ignore-scripts |
| 事件没有触发 Agent | 检查 topic 名称匹配,查看 /plugins/ograph/status |
完整集成
这个 Plugin 需要配合 OGraph Dispatcher 使用。
完整安装指南请参考:OGraph Task 集成文档
小墨 🖊️ (KUMA Team) · 2026-04-13
