emdash
emdash copied to clipboard
Feature: Auto-trigger agent on CI failure
Feature Request
Description Automatically trigger an agent to investigate and fix CI failures. When a GitHub Actions check fails on a task's branch, Emdash would spin up an agent with the failure context and let it attempt a fix — closing the feedback loop without manual intervention.
Proposed Flow
- Emdash monitors CI status for active task branches (via GitHub API / webhooks)
- When a check fails, Emdash:
- Fetches the failure logs (
gh run view --log-failed) - Spins up an agent in the task's worktree
- Provides the CI failure context as the initial prompt (e.g., "CI failed with: [error logs]. Please investigate and fix.")
- Fetches the failure logs (
- The agent analyzes the failure, makes fixes, and commits
- CI re-runs automatically on the new push
Configuration Options
- Toggle: Enable/disable per project or globally
- Auto-fix mode: Agent fixes and commits automatically (full auto)
- Review mode: Agent proposes a fix but waits for user approval before committing
- Max retries: Limit how many times the agent retries on repeated failures
- Check filter: Only trigger on specific checks (e.g., tests, lint — not deploy)
Why This Matters
CI failures are one of the most common interruptions in a development workflow. Today, the developer has to manually check what failed, context-switch back to the code, fix it, and push again. Auto-triggering an agent on failure turns this into a hands-off process — the agent handles the fix while the developer stays focused on other work.
Technical Considerations
- Poll
gh pr checksor use GitHub webhooks for real-time status updates - Parse failure logs to extract actionable error context
- Reuse existing worktree and agent infrastructure
- Consider rate limiting to avoid infinite fix loops on persistent failures
created this pr #1532 for this issue