-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Trigger loops when issues are labeled, assigned, or commented on via GitHub webhooks.
Key Features
- Local webhook receiver for GitHub events
- Polling fallback when webhook server unavailable
- Rule-based loop spawning (label triggers, assignee triggers)
- Rate limiting to prevent spam loops
Implementation Phases
Phase 1: Webhook Configuration
- Extend
AppSettingsinsrc/core/state.ts:webhooks?: { enabled: boolean; port?: number; // default 8787 secret?: string; // GitHub webhook secret rules: WebhookRule[]; }
WebhookRuletype:{ event: 'labeled' | 'assigned' | 'commented'; match: { label?: string; assignee?: string; bodyPattern?: string }; action: { agent: AgentType; autoStart: boolean }; }
Phase 2: Webhook Server
- Create
src/core/webhooks.ts:- Bun.serve() HTTP listener on configured port
- GitHub signature verification (HMAC SHA256)
- Parse webhook payloads for issue events
- Route to rule matcher
Phase 3: Rule Engine
- Match incoming events against configured rules
- On match: create loop via existing
addLoop()in state - Emit event via
loopEventsfor UI notification - Log webhook activity to dedicated log file
Phase 4: Polling Fallback
- CLI option:
alex webhook --poll --interval 60 - Use
gh apito check recent issue events - Track last-seen event timestamp
- Apply same rules as webhook mode
Phase 5: UI Integration
- Add webhook status indicator in header
- Show recent webhook activity in logs
- Menu option to start/stop webhook server
Files to Create/Modify
src/core/webhooks.ts- New webhook server + rulessrc/core/state.ts- Extend AppSettingssrc/cli.ts- Addwebhooksubcommandsrc/ui/layout.ts- Webhook status indicator
Example Config
webhooks:
enabled: true
port: 8787
rules:
- event: labeled
match: { label: "ralph-loop" }
action: { agent: claude, autoStart: true }
- event: assigned
match: { assignee: "alexh" }
action: { agent: claude, autoStart: false }Acceptance Criteria
- Local webhook receiver (or polling fallback)
- Configure rules: "on label:ralph-loop, spawn loop"
- Event types: labeled, assigned, commented
- Rate limiting to prevent spam
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels