agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

feat: OpenClaw integration as escalation destination (Tier 3)

Open AgentWrapper opened this issue 8 months ago • 1 comments

Problem

AO needs a way to escalate to humans via chat interfaces (Telegram, WhatsApp, Discord) when the orchestrator can't resolve an issue. Currently the notifier plugins (desktop, slack, webhook) don't support bidirectional chat.

Proposal

Build an OpenClaw integration that participates in the same escalation protocol as the orchestrator and agent sessions.

Key insight

OpenClaw is NOT a "notifier plugin" — it's a peer in the escalation protocol. The protocol is the same whether the message goes agent→orchestrator or orchestrator→human:

escalate(from: sessionId, to: destination, context: {...})

Where destination can be orchestrator, openclaw, or another agent session.

What this enables

  1. Orchestrator escalates to human → message arrives in Telegram/WhatsApp via OpenClaw
  2. Human responds in chat → OpenClaw routes response back to orchestrator or directly to agent session
  3. Bidirectional: human can proactively send commands (ao send ao-5 "try rebasing on main")
  4. Human can approve/reject merge requests from chat

Implementation options

  • notifier-openclaw plugin that uses openclaw system event CLI to send messages
  • OpenClaw webhook endpoint that AO can POST structured escalation events to
  • OpenClaw sessions_send API for direct message routing

The protocol

Both the orchestrator and OpenClaw should use the same escalation message format:

{
  "type": "escalation",
  "from": "ao-5",
  "reason": "ci_failed",
  "attempts": 5,
  "context": { "checks": [...], "pr": "#339" },
  "actions": ["retry", "skip", "kill", "merge"]
}

Depends on

  • Tier 1: Default CI auto-injection
  • Tier 2: Orchestrator-as-middleman (#351)

AgentWrapper avatar Mar 07 '26 21:03 AgentWrapper

Closing this as part of the migration cleanup for the ground-up rewrite of Agent Orchestrator.

This item was opened more than a month before the migration batch and the codebase has been replaced, so this thread no longer maps cleanly onto the current source tree.

If something here still needs tracking, please reopen this item or open a fresh one against the new tree. Thank you for contributing.

harshitsinghbhandari avatar Jun 24 '26 14:06 harshitsinghbhandari