Skip to content
GitHub stars

Event Streaming

Stream review events in real-time for integrations, notifications, or custom tooling:

Terminal window
roborev stream # Stream all events
roborev stream --repo . # Stream events for current repo only

Event Format

Events are emitted as newline-delimited JSON (JSONL):

{"type":"review.started","ts":"2025-01-11T10:00:00Z","job_id":42,"repo":"/path/to/repo","repo_name":"myrepo","sha":"abc123","agent":"codex"}
{"type":"review.completed","ts":"2025-01-11T10:01:30Z","job_id":42,"repo":"/path/to/repo","repo_name":"myrepo","sha":"abc123","agent":"codex","verdict":"P"}

Event Types

TypeDescription
review.startedReview job started processing
review.completedReview finished successfully
review.failedReview failed (includes error field)
review.canceledReview was canceled

Event Fields

All events include:

  • type: Event type
  • ts: ISO 8601 timestamp
  • job_id: Unique job identifier
  • repo: Repository path
  • repo_name: Repository display name
  • sha: Commit SHA (or dirty for uncommitted changes)
  • agent: Agent that processed the review

Additional fields:

  • verdict: Pass/Fail verdict (on review.completed)
  • error: Error message (on review.failed)

Filtering with jq

Use jq to filter events:

Terminal window
# Only completed reviews
roborev stream | jq -c 'select(.type == "review.completed")'
# Only failures
roborev stream | jq -c 'select(.type == "review.failed")'
# Specific repo
roborev stream | jq -c 'select(.repo_name == "myproject")'
# Failed verdicts
roborev stream | jq -c 'select(.verdict == "F")'

Integration Examples

Desktop Notifications (macOS)

Terminal window
roborev stream | while read -r event; do
type=$(echo "$event" | jq -r '.type')
repo=$(echo "$event" | jq -r '.repo_name')
if [ "$type" = "review.completed" ]; then
verdict=$(echo "$event" | jq -r '.verdict')
if [ "$verdict" = "F" ]; then
osascript -e "display notification \"Review failed\" with title \"$repo\""
fi
fi
done

Webhook

Terminal window
roborev stream | while read -r event; do
curl -X POST -H "Content-Type: application/json" \
-d "$event" https://your-webhook.example.com/reviews
done

See Also