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:
- Codality waits for all check runs on that commit to complete (debounce)
- Fetches failure details: check output text and annotations
- Starts a new agent session with the failure details as context
- The agent reads the errors, fixes the code, commits, and pushes
- 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 retryslash 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):
- The agent starts a new session with the comment text as context
- It reads the comment, makes any requested changes, and pushes
- 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:
- The agent starts a new session with the review body and inline comments as context
- It addresses each piece of feedback
- 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:
- GitHub integration connected and installed
- A linked repository
protected_mainenabled
Disabling protected_main or unlinking the repository disables the feedback loop for that project.