# Understand root cause analysis

When your pull request's CI fails, CI Autopilot automatically investigates the failure and posts a detailed analysis as a comment within a few minutes. This analysis helps you quickly understand what went wrong and how to fix it.

You'll know the analysis is complete when you see a comment from the `trunk-io` bot:

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-62cdc44397a9bd94eb9db9f4cbfab7ca387d03b7%2FScreenshot%202025-09-12%20at%2010.22.02%E2%80%AFAM.png?alt=media" alt=""><figcaption><p>CI Autopilot PR Comment</p></figcaption></figure>

Each comment includes the following details:

* **Test summary**: A brief description of the issue
* **Affected jobs or tests (when** [**test results are uploaded**](https://docs.trunk.io/ci-autopilot/overview/get-started/upload-test-reports)**)**: The jobs or a list of all the tests that failed with the same root-cause
* **Root-cause**: An explanation of the root cause, what changes caused it, and the effects
* **Proposed fixes:** Suggested code changes to fix the issue
* **Autofix options:** Instructions on how to apply the fix - either as a stacked pull request

### Why failure grouping matters

Instead of getting 15 separate comments for 15 related test failures, CI Autopilot groups them into a single comment when they share the same root cause. This means one fix can resolve multiple test failures.

### What's next?

After reviewing the root-cause analysis and fix suggestions, users can request fixes on PRs or apply them with [MCP](https://docs.trunk.io/flaky-tests/use-mcp-server).

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Request fixes on PRs</td><td><a href="request-fixes-on-prs">request-fixes-on-prs</a></td></tr><tr><td>Apply fixes with MCP</td><td><a href="apply-fixes-with-mcp">apply-fixes-with-mcp</a></td></tr></tbody></table>
