This document defines the normalized event contract OMC emits through the OpenClaw bridge for native Clawhip-style consumers.
- Keep the raw hook event (
event) for backward compatibility. - Add a normalized
signalobject for routing and dedupe-friendly filtering. - Make command/native gateways receive the same logical payload shape as HTTP gateways.
HTTP gateways receive JSON with this structure:
{
"event": "post-tool-use",
"instruction": "...",
"timestamp": "2026-03-09T00:00:00.000Z",
"sessionId": "...",
"projectPath": "...",
"projectName": "...",
"tmuxSession": "...",
"tmuxTail": "...",
"signal": {
"kind": "test",
"name": "test-run",
"phase": "failed",
"routeKey": "test.failed",
"priority": "high",
"toolName": "Bash",
"command": "pnpm test",
"testRunner": "package-test",
"summary": "FAIL src/example.test.ts | ..."
},
"context": {
"sessionId": "...",
"projectPath": "...",
"toolName": "Bash"
}
}| Field | Meaning |
|---|---|
kind |
Routing family: session, tool, test, pull-request, question, keyword |
name |
Stable logical signal name |
phase |
Lifecycle phase: started, finished, failed, idle, detected, requested |
routeKey |
Canonical routing key for downstream consumers |
priority |
high for operational signals, low for generic tool noise |
Additional fields may appear when applicable:
toolNamecommandtestRunnerprUrlsummary
Command gateways now get the same normalized payload through both:
- template variable:
{{payloadJson}} - env var:
OPENCLAW_PAYLOAD_JSON
They also receive convenience env vars:
OPENCLAW_SIGNAL_ROUTE_KEYOPENCLAW_SIGNAL_PHASEOPENCLAW_SIGNAL_KIND
That lets native Clawhip routing consume one contract whether the transport is HTTP or shell-command based.
session.startedsession.finishedsession.idlequestion.requestedtest.startedtest.finishedtest.failedpull-request.startedpull-request.createdpull-request.failedtool.failed
Generic tool.started / tool.finished remain available as low-priority fallback signals.
AskUserQuestionnow emits only the dedicatedquestion.requestedsignal instead of also emitting generic tool lifecycle events.- Consumers should prefer
signal.priority === "high"or explicitsignal.routeKeyfilters instead of routing directly on raw hook names.
- Raw
eventnames are preserved for backward compatibility. signalis the preferred routing surface for new native Clawhip integrations.contextremains a whitelisted subset; internal raw tool input/output are used only to derive normalized signals and are not forwarded inpayload.context.