# CI failure explainer

On public repos, explains each failed GitHub Actions run on its pull request: the failing step, likely cause, file and line, flaky or not.

Requires GitHub, through Composio. Starts from a public feed it checks.

## Install

Public repositories only: the trigger finds new failures by reading the repository's failed-run list without a token every 10 minutes. On a private repository, run it by hand with the input run\_id. Connect GitHub through Composio for the reads and the one comment. It never re-runs a job.

No one has run this against real GitHub accounts through Composio yet. Its eval cases use stand-ins.

```sh
npx @parcha/agentrun template install github:Parcha-ai/agentrun-templates/templates/ci-failure-explainer@9ed9ff98e3130d3dce065743e8c60bb13e84f646 --trust
```

Or open `<your AgentRun address>/#/templates/install?src=github%3AParcha-ai%2Fagentrun-templates%2Ftemplates%2Fci-failure-explainer%409ed9ff98e3130d3dce065743e8c60bb13e84f646`. Pinned to commit 9ed9ff98e3130d3dce065743e8c60bb13e84f646.

### Install with your agent

Copy this prompt into your coding agent:

```text
Help me install the CI failure explainer template on my existing AgentRun.

Pinned template source: github:Parcha-ai/agentrun-templates/templates/ci-failure-explainer@9ed9ff98e3130d3dce065743e8c60bb13e84f646
Read the template and its instructions: https://github.com/Parcha-ai/agentrun-templates/tree/9ed9ff98e3130d3dce065743e8c60bb13e84f646/templates/ci-failure-explainer

Ask for my AgentRun address or local installation directory if you do not already know it. Confirm which instance to use before making changes.
Read https://agentrun.ai/SKILL.md and inspect the installed version's template install help. Use the installation workflow that version supports.
Review this template's setup, instructions and requested tools with me, then install the pinned version on that instance with the settings and permissions I approve. Do not start a second instance or redeploy my existing one.
If this version cannot install templates, explain what is missing and the supported next step. Verify the result and tell me how to run the installed agent.
```

## What it does

For public repositories only, when a GitHub Actions run fails, it reads the failed jobs and the end of their logs and explains the failure in one comment on the pull request the run belongs to. The comment names the failing step, the likely cause, and the file and line when the log shows them. It also says when the failure looks flaky, such as a network timeout in a change that doesn't touch that code, or a job that passes on main. A run with no pull request, such as a push to main, gets the explanation in the run's answer and no comment. It never re-runs, cancels or edits anything. The trigger reads GitHub's list of failed runs without a token every 10 minutes, which works on public repositories only. On a private repository, run it by hand with the run's ID. Reads and comments through Composio's GitHub toolkit, and the comment waits for your OK unless you pick Never for approvals at install.

- Skill `ci-failure`: Explain one failed GitHub Actions run through Composio's GitHub tools. Page through its jobs, read the failed ones' annotations and, when needed, their logs, name the failing step, the likely cause and the file and line when GitHub or the log shows them, judge whether it looks flaky, and post one comment on the open pull request the run belongs to (none when there is none). Never re-run anything. Use for the run-failed trigger and for "why did run N fail".

## What starts it

- Checks https://api.github.com/repos/<owner>/<repo>/actions/runs?status=failure&per_page=20 every 10 minutes: each new or updated item starts one run. At most 3 at once.
- By hand, any time: from the console, the API or the CLI.

## Inputs

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `run_id` | integer, at least 1 | no | Explain one failed run by hand: the number after /actions/runs/ in its URL. Leave it out on the trigger's runs: the item names the run. Example: `19450012345`. |

### Setup, filled in once at install

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `owner` | string | yes | The GitHub account or organization that owns the repository, like Parcha-ai. |
| `repo` | string | yes | The repository's name without the owner, like agentrun. |

## What it needs

- Harness: pi, claude-agent, codex
- Model: balanced tier, medium effort
- Tools: read
- Composio GitHub tools: GITHUB_GET_A_WORKFLOW_RUN, GITHUB_LIST_JOBS_FOR_A_WORKFLOW_RUN, GITHUB_LIST_CHECK_RUN_ANNOTATIONS, GITHUB_DOWNLOAD_JOB_LOGS_FOR_A_WORKFLOW_RUN, GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY, GITHUB_LIST_PULL_REQUESTS_ASSOCIATED_WITH_A_COMMIT, GITHUB_LIST_PULL_REQUESTS_FILES, GITHUB_LIST_ISSUE_COMMENTS, GITHUB_CREATE_AN_ISSUE_COMMENT. Reads the failed workflow run, its jobs, annotations and logs, recent runs of the same workflow, and the pull request's changed files; posts one comment on that pull request. Every call is held to the repository you set. It has no tool that re-runs, cancels or deletes a run.
- Computer: Wherever your AgentRun puts a new agent
- Keys: A model key
- Learning: on

## Sample output

No sample output ships with this template yet.

## Tested

Passes 10 of 10 eval cases on pi, 10 of 10 on Claude Code and 10 of 10 on Codex. Live by hand on a real failed run (2026-11-20, pi): passed, read-only. The server denied the comment, so nothing was posted. Main's latest run had passed by then, so same_job_failing_on_base came out false against a passing base; a base failing only in other jobs is covered by the evals, not the live run.

10 eval cases: already-explained, base-fails-elsewhere, big-matrix-run, explained-on-page-2, flaky-network, injection-in-log, logs-expired, pr-moved-on, push-no-pr, test-failure.

## Source

- Package: https://github.com/Parcha-ai/agentrun-templates/tree/9ed9ff98e3130d3dce065743e8c60bb13e84f646/templates/ci-failure-explainer
- Publisher: Parcha-ai
- Author: Parcha Labs
- Version: 0.1.0
- License: Apache-2.0
- Category: Engineering
- Page: https://marketplace.agentrun.ai/templates/ci-failure-explainer/
