Channels
Moment Channel
OpenClaw channel plugin for Moment โ delivers agent task results back to Moment Backend
Configuration Example
{
"plugins": {
"load": {
"paths": [
"~/.openclaw/workspace/openclaw-moment-channel"
]
},
"entries": {
"moment": {
"enabled": true,
"config": {
"backendUrl": "https://your-moment-backend.com",
"callbackToken": "your-callback-token"
}
}
}
}
}
README
# openclaw-moment-channel
OpenClaw channel plugin for Moment. When OpenClaw finishes an agent task with `deliver=true` and `channel="moment"`, this plugin delivers the result to Moment Backend via the callback API.
## Setup
### 1. Install plugin on OpenClaw host
```bash
# Copy to OpenClaw workspace
cp -r openclaw-moment-channel ~/.openclaw/workspace/
# Or clone directly
cd ~/.openclaw/workspace
git clone [email protected]:Pianke-Moment/openclaw-moment-channel.git
```
### 2. Configure in openclaw.json
Add the plugin path and config:
```json
{
"plugins": {
"load": {
"paths": [
"~/.openclaw/workspace/openclaw-moment-channel"
]
},
"entries": {
"moment": {
"enabled": true,
"config": {
"backendUrl": "https://your-moment-backend.com",
"callbackToken": "your-callback-token"
}
}
}
}
}
```
- `backendUrl`: Moment Backend base URL
- `callbackToken`: must match the `MOMENT_CALLBACK_TOKEN` env var on the backend
### 3. Restart OpenClaw Gateway
```bash
launchctl stop ai.openclaw.gateway && sleep 2 && launchctl start ai.openclaw.gateway
```
### 4. Verify
```bash
openclaw plugins list
# Should show "Moment" as loaded
```
## How it works
```
Moment Backend
โ POST /hooks/agent
โ { message, deliver: true, channel: "moment", to: "<task_id>" }
โผ
OpenClaw Gateway
โ Agent executes task
โ deliver=true โ calls moment channel sendText()
โผ
This Plugin (sendText)
โ POST <backendUrl>/api/v1/tasks/callback
โ { run_id: "<task_id>", text: "<result>" }
โ Authorization: Bearer <callbackToken>
โผ
Moment Backend
โ Updates AgentTask status โ completed
โ Pushes update to frontend via SSE
โผ
Moment App (frontend)
โโ Slot card shows result
```
## Backend integration note
The `to` parameter received by `sendText()` is whatever Moment Backend passes as `to` in the POST /hooks/agent call. The plugin forwards it as `run_id` in the callback payload.
For this to work, the backend must pass the **AgentTask ID** (not user_id) as the `to` parameter when dispatching tasks. See ADR-0010 for details.
channels
Comments
Sign in to leave a comment