#i am having problem with making agents communicate to each other.
1 messages · Page 1 of 1 (latest)
Yep — don’t use Telegram bot-to-bot messages for this. Use OpenClaw’s native wake path instead.
First: what openclaw --version are you on?
Assuming a recent version, the trigger you want is:
openclaw system event --text "Check your inboxes now" --mode now
That enqueues a system event and triggers heartbeat immediately. If multiple agents have heartbeat configured, it wakes those agent heartbeats.
For an external process/webhook, use:
POST /hooks/wake
{
"text": "Check your inboxes now",
"mode": "now"
}
So the pattern should be:
- Each agent has an inbox somewhere it can read: file, DB, queue, etc.
HEARTBEAT.mdsays: “Check your inbox; if nothing relevant, replyHEARTBEAT_OK.”- When Agent A writes to Agent B’s inbox, trigger:
openclaw system event --text "New agent inbox item; check inboxes" --mode now
or call /hooks/wake.
Docs:
- https://docs.openclaw.ai/gateway/heartbeat
- https://docs.openclaw.ai/cli/system
- https://docs.openclaw.ai/automation/cron-jobs#post-hookswake
If you need agent-to-agent comms, I’d treat Telegram as delivery only, not the bus. Use heartbeat/wake + a shared inbox instead.
agents are in different containers
Ah, then use HTTP hooks between containers, not local CLI.
In each target agent container, enable hooks:
{
hooks: {
enabled: true,
token: "use-a-random-shared-secret",
path: "/hooks"
}
}
Then from another container call the target Gateway:
curl -X POST http://agent-b:18789/hooks/wake \
-H "Authorization: Bearer use-a-random-shared-secret" \
-H "Content-Type: application/json" \
-d '{"text":"New inbox item from another agent; check your inbox","mode":"now"}'
Docker-compose pattern:
services:
agent-a:
networks: [agents]
agent-b:
networks: [agents]
ports:
- "127.0.0.1:18789:18789" # optional; internal service name works without exposing publicly
networks:
agents:
Important bits:
- Put the agents on the same Docker network.
- Use the service name, e.g.
http://agent-b:18789/hooks/wake. - Keep hooks private to Docker/tailnet/localhost; don’t expose them publicly.
- Use a hooks token, not the gateway token.
- Still add
HEARTBEAT.mdin each agent workspace telling it to check its inbox.
Docs: https://docs.openclaw.ai/gateway/heartbeat and https://docs.openclaw.ai/automation/cron-jobs#post-hookswake