Context
The orchestration loop sends Telegram notifications via sendAlert() (openclaw CLI) after task completion or failure. Currently failing with:
[openclaw] Failed to send alert: [claw-engine/session_completed] | ✅ Task completed: ...
Investigation needed
- Check if
openclaw message send works from the daemon process context
- The daemon runs as LaunchAgent — may not have the right env vars or socket access for openclaw
sendAlert() in src/integrations/openclaw/client.ts calls openclaw message send via execFile
- The alert is fire-and-forget (non-blocking), so task execution is not affected
Steps to reproduce
- Run
claw submit "any task" --repos ~/server/apps/claw-engine
- Wait for daemon to process
- Check logs:
tail ~/server/logs/claw-engine.log
- Look for
[openclaw] Failed to send alert line
Expected behavior
After task completion, receive a Telegram message via @MadzixClawBot with:
- Task title
- Status (completed/failed)
- PR URL (if created)
- Token usage
Files involved
src/integrations/openclaw/client.ts — sendAlert function
src/core/orchestration-loop.ts — calls sendAlert at end of pipeline
Context
The orchestration loop sends Telegram notifications via
sendAlert()(openclaw CLI) after task completion or failure. Currently failing with:Investigation needed
openclaw message sendworks from the daemon process contextsendAlert()insrc/integrations/openclaw/client.tscallsopenclaw message sendvia execFileSteps to reproduce
claw submit "any task" --repos ~/server/apps/claw-enginetail ~/server/logs/claw-engine.log[openclaw] Failed to send alertlineExpected behavior
After task completion, receive a Telegram message via @MadzixClawBot with:
Files involved
src/integrations/openclaw/client.ts— sendAlert functionsrc/core/orchestration-loop.ts— calls sendAlert at end of pipeline