docs
v0.7.12

CI Feedback Loop

The agent automatically responds to CI failures, PR comments, and review feedback on GitHub.

CI failure auto-fix

When a CI check fails on a PR linked to a Codality ticket:

  1. Codality waits for all check runs on that commit to complete (debounce)
  2. Fetches failure details: check output text and annotations
  3. Starts a new agent session with the failure details as context
  4. The agent reads the errors, fixes the code, commits, and pushes
  5. A status comment is posted to the PR: "🔄 CI auto-fix attempt 1/3"

Codality's own check runs (codality/agent, codality/review, codality/merge-readiness) are excluded from triggering this.

Rate limiting

To prevent infinite loops (agent pushes → CI fails → agent retries → CI fails):

  • Maximum 3 consecutive autonomous retries per PR
  • After 3 failures, the agent posts: "I've attempted 3 fixes and it's still not passing. Needs human attention."
  • The ticket stays In Review — the code exists, it just needs help

The retry counter resets when:

  • A human posts a comment on the PR
  • Someone uses the /codality retry slash command
  • A review with feedback is submitted

This means any human interaction gives the agent 3 more attempts.

PR comment response

When someone posts a comment on a PR linked to a Codality ticket (that isn't a slash command):

  1. The agent starts a new session with the comment text as context
  2. It reads the comment, makes any requested changes, and pushes
  3. A completion comment is posted with a summary of changes

Bot comments (from users ending in [bot]) are ignored to prevent self-triggering loops.

Review changes requested

When a reviewer submits a review with Changes Requested on a tracked PR:

  1. The agent starts a new session with the review body and inline comments as context
  2. It addresses each piece of feedback
  3. It pushes the fixes and posts a completion comment

Status comments

The agent posts status comments on PRs when triggered:

  • Start: "🔄 Working on this — triggered by [CI failure / comment / review]"
  • Complete: "Done — pushed new changes" with a summary of recent commits
  • Exhausted: "I've attempted 3 fixes. Needs human attention."

Frontend indicators

When the feedback loop triggers an agent session, the Codality UI shows a status banner above the ticket action bar:

  • 🔧 CI auto-fix started
  • 💬 Comment response started
  • 📝 Review response started

These appear via real-time SSE events.

Disabling the feedback loop

The feedback loop only activates for projects with:

  1. GitHub integration connected and installed
  2. A linked repository
  3. protected_main enabled

Disabling protected_main or unlinking the repository disables the feedback loop for that project.