AI triage agents that keep 51Degrees’ CI green
The client
The challenge
What we built
Collect
It reads the CI dashboards to find every monitored workflow, and picks the newest run on each tracked branch.
Analyse
For each failure, it downloads the logs and starts a Claude agent. The agent explores the logs with shell tools, reads the relevant source and writes a short root-cause paragraph that links to the exact files and lines.
Decide
If the agent judges a failure flaky, it flags it, and the pipeline re-runs that job exactly once.
Escalate
If the re-run fails too, a second agent pass looks at the new logs, this time aiming for a concrete fix rather than another retry.
Report
One markdown report goes to the job summary, and a short summary is posted to the team's Slack.
Safety by design
- The agent never holds a GitHub credential. The parent process downloads logs and source, and strips tokens from the agent's environment.
- The agent can't edit files. Its only write to GitHub is a single re-run. It posts no comments, opens no issues and pushes nothing.
- Logs stay on the runner. The agent reads only the slices it needs, so whole logs are never sent to the model.
Results
- Every morning, the agent triages more than 80 workflows across two dashboards before the team starts work.
- In 100 nightly cloud-publish runs since July 2026, it caught 24 failures. 4 were flaky and fixed themselves after the automatic re-run, with nobody involved. The other 20 reached engineers with a root-cause analysis already written.
- Engineers now start from a diagnosis, such as which keys and properties differed or which commit added the test, instead of from a raw log.
- Running the agent for months exposed real data problems in the CI tooling (stale run listings from the GitHub API, cron-timing races), and these were fixed along the way.