emdash icon indicating copy to clipboard operation
emdash copied to clipboard

Feature: Auto-trigger agent on CI failure

Open arnestrickmann opened this issue 8 months ago • 1 comments

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

  1. Emdash monitors CI status for active task branches (via GitHub API / webhooks)
  2. 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.")
  3. The agent analyzes the failure, makes fixes, and commits
  4. 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 checks or 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

arnestrickmann avatar Mar 09 '26 21:03 arnestrickmann

created this pr #1532 for this issue

yashdev9274 avatar Mar 19 '26 12:03 yashdev9274