Skip to content

Nori Use cases

Have a coding agent fix failing CI and triage flaky tests automatically

To have a coding agent fix failing CI on your pull request automatically, send each failed GitHub Actions run to a Nori webhook automation. Nori, a cloud coding agent platform, starts Claude Code, Codex or another agent on a fresh cloud machine, reads the failed job's logs, fixes the cause on the PR branch and reports in Slack. For one-off fixes, comment @nori on the PR. For flaky tests, run a nightly scheduled triage.

Three ways to have a coding agent fix failing CI on a pull request and triage flaky tests: an @nori comment on the PR, a GitHub Actions webhook on every failed run, and a nightly flaky-test automation.

Quick answer

Use three pieces. For one pull request, comment @nori CI is failing, fix it on the PR: the agent reads its check runs and workflow logs, fixes the cause and pushes to the branch. For every pull request, add a small GitHub Actions workflow that posts failed runs to a Nori webhook automation, so the fix starts without anyone asking. For flaky tests, schedule a nightly automation that finds tests that failed and then passed with no code change, proves each is flaky, and opens one fix pull request per test.

Why flaky tests and red CI cost so much time

A failing check on a pull request is rarely hard. It is slow. The author opens the logs, finds the failing step, reproduces it locally, fixes it and pushes. When the failure is a flaky test, they rerun the job, wait 20 minutes and hope.

Flaky tests are the expensive case. Each rerun burns CI minutes. Each red build trains people to ignore red builds. And nobody owns the fix, because the test belongs to someone else and fails only sometimes.

Both jobs suit a coding agent. Reading logs, reproducing a failure and running a test 30 times are mechanical. What matters is where the agent runs and how it is started, so that nobody has to remember to ask.

Three ways to start the agent

Which trigger fits which CI problem.
TriggerStarts whenBest for
@nori comment on the PRA person asksOne failing PR where the author wants help now
Webhook automation from GitHub ActionsAny CI run on a pull request failsTeams that want every red PR looked at before a person opens it
Nightly scheduled automationA cron line, such as 02:00 on weeknightsFlaky tests on main that fail at random

On a pull request conversation, the agent can read the PR's commit statuses, check runs and workflow runs with their logs. Each pull request has one ongoing conversation, so a later comment continues where the last one stopped. See the GitHub PR comment agent for that flow in detail. For production alerts rather than CI failures, see on-call alert triage in Slack.

How to send failed CI runs to an agent, step by step

  1. Install the GitHub app. Install the Jiro (by Nori) GitHub app on the repository and add the repository under Settings → Environment. Install your test toolchain in the setup script so the agent can run the suite.
  2. Create the webhook automation. In Nori, open Automations → New automation, choose From a webhook, paste the prompt from the example below, and deliver it to a Slack thread in #eng-ci. A member's automation waits for admin approval.
  3. Copy the webhook URL. Use Copy webhook URL and save it as a GitHub Actions secret named NORI_CI_WEBHOOK_URL. Anyone with the URL can start a run.
  4. Add the workflow. Commit the workflow_run workflow below to .github/workflows/. It runs after your CI workflow finishes and posts only failures on pull requests from the same repository.
  5. Test it. Use Run now on the automation with a sample payload, or push a commit that breaks one test on a scratch branch.
  6. Set a retry limit. Keep the two-attempt rule in the prompt so a fix that fails again comes back to a person instead of looping.

Worked example: a failing PR fixed before review

A 20-engineer team runs a workflow named CI on every pull request. Repository, channel and test names are illustrative.

The GitHub Actions workflow

name: Send CI failures to Nori
on:
  workflow_run:
    workflows: [CI]
    types: [completed]

jobs:
  notify:
    if: >-
      github.event.workflow_run.conclusion == 'failure' &&
      github.event.workflow_run.event == 'pull_request' &&
      github.event.workflow_run.head_repository.full_name == github.repository
    runs-on: ubuntu-latest
    steps:
      - name: Post the failed run to Nori
        env:
          NORI_URL: ${{ secrets.NORI_CI_WEBHOOK_URL }}
          REPO: ${{ github.repository }}
          BRANCH: ${{ github.event.workflow_run.head_branch }}
          SHA: ${{ github.event.workflow_run.head_sha }}
          RUN_URL: ${{ github.event.workflow_run.html_url }}
        run: |
          jq -n --arg repo "$REPO" --arg branch "$BRANCH" \
                --arg sha "$SHA" --arg run "$RUN_URL" \
                '{repo:$repo, branch:$branch, sha:$sha, run_url:$run}' |
          curl -sS -X POST "$NORI_URL" \
               -H "Content-Type: application/json" --data @-

The automation prompt

A CI run failed on a pull request. The payload has the repo, branch,
commit and run URL.

1. Read the failed jobs' logs (gh run view <id> --log-failed).
2. Classify the failure: CODE (the PR broke it), FLAKY (the test fails
   on main too, or passes on rerun with no change), or INFRA (runner,
   network, registry).
3. CODE: check out the branch, reproduce the failure, fix it, run the
   affected tests, and push one commit titled "fix(ci): <what>".
   Comment on the PR with the cause and the tests you ran.
4. FLAKY or INFRA: push nothing. Comment on the PR with the evidence.
5. If this branch already has 2 "fix(ci):" commits from you, push
   nothing and ask the author to take over.
6. Never merge, never force-push, never change workflow files.

Reply with: class, cause, commit or comment link.

What the team sees

#eng-ci

Nori  11:42
Automation: CI failure to fix (webhook)

  Nori  11:51
  Class: CODE
  PR #1432 "Add currency to invoice export" in billing-api
  Cause: export_test.go expects 6 columns; the PR added a 7th
  (currency) but did not update the CSV header fixture.
  Pushed 7c1e9a2 "fix(ci): add currency column to export fixture".
  Ran go test ./export/... : 38 passed. CI is running again.

The author opened the pull request at lunch and found it green with one extra commit. If the fix was wrong, a reply in the Slack thread or an @nori comment on the PR asks for another approach.

Triage flaky tests every night

A flaky test needs a different job from a failing PR. Nobody is waiting on it, the evidence is spread across many runs, and proving the fix means running the test many times. That is a good use of a nightly run on its own machine.

Schedule a coding agent overnight shows how to set up the cron automation. This is the prompt to give it, built around evidence:

In the web-app repository:
1. List CI runs on main from the last 7 days (gh run list --branch
   main --json databaseId,conclusion,headSha,createdAt).
2. Find tests that failed and then passed on the same commit.
3. Pick the test with the most such failures. Run it 50 times.
   If it never fails, report and stop.
4. Classify the cause: ORDER (depends on another test), TIME (clock,
   timezone, sleep), SHARED STATE (database, files, globals),
   NETWORK (real calls), or RACE (async ordering).
5. Fix the cause, not the symptom. No retries, no longer timeouts,
   no skip markers.
6. Run it 50 times again. Open a PR only at 0 failures, with both
   counts in the description. Never merge.
Reply with a table: test, failures in 7 days, cause class, PR.
Flaky test causes and the fix the prompt asks for.
Cause classTypical signFix the agent should make
ORDERFails only when run after a certain testReset the shared fixture in setup
TIMEFails near midnight or in another timezoneFreeze the clock or pass the time in
SHARED STATEFails when tests run in parallelGive each test its own database schema or temp directory
NETWORKFails with timeouts to an outside hostReplace the real call with a local fake
RACEFails under load, passes aloneWait on the event, not on a sleep

Nori also ships a managed Test gardening automation. An admin turns it on under Automations → Managed by Nori. Each week it adds a regression test for recent untested code, fixes a flaky test, or removes a test that tests nothing, and by default it asks in its chat thread before it opens a pull request.

Guardrails

  • Branch protection decides. The agent pushes to the PR branch or opens pull requests. Required reviews and checks still apply.
  • No masking. The prompts forbid retries, skips and longer timeouts, so a fix removes the cause.
  • Loops stop. The two-attempt rule hands a stubborn failure back to a person.
  • Payloads are data. Nori passes the webhook body to the agent as untrusted data.
  • Runs are bounded. Each automation run stops at its time limit, 6 hours by default.

The same setup runs on Claude Code, Codex, Cursor, Gemini, OpenCode or Pi, on your own subscription or keys, with your team's skillset and shared memories loaded in every session. Teams with CI inside a private network can run Nori on-prem or in their own AWS or Azure account. See Nori Enterprise.

Frequently asked questions

How do I have a coding agent fix failing CI on my PR automatically?

Add a GitHub Actions workflow_run workflow that posts failed runs to a Nori webhook automation. The agent reads the failed job logs, fixes the cause on the PR branch, runs the tests and comments on the pull request. For a single PR, comment @nori on it instead.

Can the agent read GitHub Actions logs?

Yes. Sessions can read CI status in the repositories the GitHub app covers, and a pull request conversation can read that PR's commit statuses, check runs and workflow runs with their logs.

Will the agent just rerun or skip flaky tests?

Not with the prompts on this page. They forbid retries, skip markers and longer timeouts, require the test to be run 50 times before and after, and open a pull request only when the fix reaches zero failures.

What about pull requests from forks?

The example workflow skips them, because a fork's branch sits outside the repositories the GitHub app covers. A maintainer can still ask for help with an @nori comment on the pull request.

How do I stop the agent from looping on the same failure?

Put a limit in the prompt. The example stops after two fix commits on a branch and asks the author to take over.

Does Nori have a built-in flaky test automation?

Yes. The managed Test gardening automation, off until an admin turns it on, can fix a flaky test each week. It asks in its chat thread before opening a pull request by default.

Sources

Read on December 4, 2026.