ENGINEERING

Flaky-Test Triage Agent with Root-Cause Draft

An agent inspects a flaky test's recent traces, drafts a likely root-cause hypothesis (timing, ordering, network), and posts it on the quarantine issue with a suggested fix.

CategoryEngineering
Enginepaperclip
Difficultyadvanced
Triggerevent
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerTest quarantined, needs-triage (GitLab webhook)GitLabGitLab
  • ActionFetch recent traces and test sourceGitLabGitLab
  • ActionClassify flakiness pattern with LLMOpenAI
  • LogicRoute by confidence (auto vs human)
  • ActionPost root-cause hypothesis on Linear issueLinearLinear
  • OutputNotify assignee in SlackSlack

What it does

This agent-driven workflow goes beyond detection: it reads the failing job traces for a quarantined test, classifies the likely cause (race condition, test ordering, network timeout, shared fixture), and writes a structured root-cause hypothesis with a suggested fix directly onto the Linear quarantine issue.

When to use it

Use it to shorten the time a test sits in quarantine. Instead of an engineer starting from a blank trace, they open the issue and find a reasoned first guess and a pointer to the suspicious code.

How it works

  1. 1A GitLab webhook fires when a test is newly quarantined and labeled `needs-triage`.
  2. 2The flow fetches the last several failing traces and the test source via the GitLab API.
  3. 3The agent analyzes the traces with an LLM to classify the flakiness pattern and pinpoint suspect lines.
  4. 4A logic step routes low-confidence results to a human and high-confidence ones to auto-comment.
  5. 5It posts the root-cause hypothesis and suggested fix as a comment on the Linear issue.
  6. 6It notifies the assignee in Slack that triage notes are ready.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect LinearIssues, projects, cycles, triage.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.