> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reliantlabs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Go from a production error to a reviewed fix

> Take a production error to a merged, deployed fix: an on-call agent files an investigated issue, you approve it, and an agent opens a pull request you review.

This guide follows one production error to a fix that is reviewed, merged and live, with the error resolved in the release that fixed it. Each hop has its own guide; this page shows how they connect and who acts at each one.

It is two linked [Autopilot](https://docs.reliantlabs.io/guides/autopilot.md) workflows with a person between them. On-call files an investigated, deduplicated GitHub issue. A person decides it should be fixed. The issue worker opens a pull request. A person reviews and merges it, and you ship it.

| Hop | Done by |
| - | - |
| Error grouped into an issue, alert fires | Automated (Reliant hosting) |
| GitHub issue filed and investigated, labelled `agent:triage` | Automated (Autopilot on-call) |
| Issue promoted to `agent:ready` | **You** |
| Failing test, fix and pull request | Automated (Autopilot issue worker) |
| Review and merge | **You** |
| Resolve, release, deploy and verify | **You** |

## Before you begin

* A Forge project on a hosted environment, which gets error issues and the default alerts ([deploy a Go API](https://docs.reliantlabs.io/guides/hosting/deploy-go-api-managed-postgres.md) or [a static site](https://docs.reliantlabs.io/guides/forge/deploy-static-site-cdn.md)).
* On-call turned on for the repository ([turn alerts into GitHub issues](https://docs.reliantlabs.io/guides/workflows/production-alerts-to-github-issues.md)).
* The issue worker turned on for the same repository, and, in an organization, an organization AI account that can run it ([turn labelled issues into pull requests](https://docs.reliantlabs.io/guides/workflows/github-issues-to-pull-requests.md)).
* The `obs:triage` permission, to resolve issues ([credentials](https://docs.reliantlabs.io/hosting/observability/forge-obs.md#credentials)).

**1. Check both workflows before they run**

Both built-ins ship with scenarios that mock GitHub and the agents, so you can see the gates hold without spending tokens:

```bash terminal theme={null}
reliant workflow scenario run --include-builtins | grep -E 'autopilot-(oncall|issue-worker)/'
```

```text theme={null}
  ✓ autopilot-issue-worker/gate_still_failing_after_retry_publishes_nothing (27ms)
  ✓ autopilot-issue-worker/trusted_labeler_opens_pr (26ms)
  ✓ autopilot-issue-worker/unwatched_repo_refused (6ms)
  ✓ autopilot-oncall/issue_regression_finds_the_filed_error (7ms)
  ✓ autopilot-oncall/never_sets_the_ready_label (11ms)
  ✓ autopilot-oncall/new_issue_alert_is_keyed_by_its_issue (19ms)
  …
```

All 45 pass (22 on-call, 23 issue worker). `never_sets_the_ready_label` proves on-call stops at `agent:triage`. `trusted_labeler_opens_pr` shows a trusted person's label ending at a pull request, not a merge.

**2. An error becomes an issue**

Forge groups errors into issues, ties each to the release it first appeared in, and fires a `NewIssue` alert for a new one:

```bash terminal theme={null}
reliant forge obs status prod
```

[Find which release introduced an error](https://docs.reliantlabs.io/guides/observability/find-release-that-caused-error.md) shows how to read the issue.

**3. On-call files one GitHub issue**

Within a few minutes the activation fires and opens an issue in the mapped repository, labelled `agent:triage`, with a severity, evidence, a suspected cause and a proposed fix. Its **Issue key** is the forge issue id, written without dashes, next to a link to the issue in the console.

The key is what deduplicates: if the error regresses or spikes while the GitHub issue is open, on-call comments on it instead of filing another. See [what it files](https://docs.reliantlabs.io/guides/workflows/production-alerts-to-github-issues.md).

**4. Decide whether an agent should fix it**

This is the first gate, and only a person passes it. Read the write-up next to the error itself, from your checkout so you also get the suspect commits:

```bash terminal theme={null}
reliant forge obs issue <issue id> prod
```

If the fix belongs to an agent, swap the label:

```bash terminal theme={null}
gh issue edit <number> --remove-label agent:triage --add-label agent:ready
```

Otherwise fix it yourself, or close it as noise. If the release is hurting users now, [redeploy the last good release](https://docs.reliantlabs.io/guides/hosting/recover-from-bad-deploy.md) first; nothing rolls back on its own.

**5. The issue worker opens a pull request**

The label starts a run that writes a failing test and the fix in a worktree, runs your `gate_command`, and pushes `autopilot/issue-<number>`. You get a pull request from `reliant-labs[bot]` that says `Closes #<number>` and carries `agent:authored`. If the agent could not finish, the issue gets `agent:punted` or `agent:blocked` and a comment saying why ([what you get](https://docs.reliantlabs.io/guides/workflows/github-issues-to-pull-requests.md)).

**6. Review and merge**

This is the second gate: Autopilot never approves or merges. Review the change as you would a teammate's, optionally after the [AI pull request reviewer](https://docs.reliantlabs.io/guides/workflows/review-pull-requests-with-ai.md) has read it, and merge it yourself. Merging closes the GitHub issue. It does not change the error issue in forge.

**7. Resolve the error in the next release**

Tie the error to the release that will carry the fix:

```bash terminal theme={null}
reliant forge obs issue resolve <issue id> prod --in next
```

Events from the release live now do not reopen it; an event from any later release reopens it as **regressed**.

**8. Ship the fix and verify it**

Cut a release from the merged commit, prove it in staging and [promote the same bytes](https://docs.reliantlabs.io/guides/hosting/promote-release-staging-to-production.md). Then judge production:

```bash terminal theme={null}
reliant forge obs check prod --wait --json
reliant forge obs issues prod --status resolved
```

Exit 0 means PASS, 1 a regression, 2 not proven good, 8 the wait ran out ([how verdicts work](https://docs.reliantlabs.io/deep-dives/how-release-verdicts-work.md)). The error should be listed as resolved and stay that way.

## What this does not do

* **It never merges, deploys or rolls back.** Autopilot files issues and opens pull requests. A workflow you write yourself can merge with `github/pr.merge@1` ([merging is a workflow step](https://docs.reliantlabs.io/integrations/github.md#merging-is-a-workflow-step-never-an-agent-tool)), but none of the built-ins do.
* **On-call does not read your logs or traces.** It works from the error's title, culprit, first build, console link and the code. For a deeper look, [debug production with an agent](https://docs.reliantlabs.io/guides/observability/debug-production-with-ai-agent.md).
* **Merging does not resolve the error.** Resolve it yourself, as in step 7. If the error returns after the fix ships, it reopens as regressed, and because the GitHub issue is now closed, on-call files a new one.

## Troubleshooting

> [accordion] obs status shows an alert firing, but no GitHub issue appears
>
> Check the activation's firings and its alert receiver as in the on-call guide's [troubleshooting](https://docs.reliantlabs.io/guides/workflows/production-alerts-to-github-issues.md#troubleshooting).

> [accordion] This automation runs only on its organization's AI accounts, and none of them can run the flagship model
>
> The issue worker's firing failed before any work. An admin adds an organization AI account, then you label the issue again ([details](https://docs.reliantlabs.io/guides/workflows/github-issues-to-pull-requests.md#troubleshooting)).

## Next steps

> [card] [Alerts to GitHub issues](https://docs.reliantlabs.io/guides/workflows/production-alerts-to-github-issues.md)
>
> Turn on on-call and see what it files.

> [card] [Issues to pull requests](https://docs.reliantlabs.io/guides/workflows/github-issues-to-pull-requests.md)
>
> Turn on the issue worker and review its work.

> [card] [Find the culprit release](https://docs.reliantlabs.io/guides/observability/find-release-that-caused-error.md)
>
> Read an error issue and resolve it in a release.

> [card] [Recover from a bad deploy](https://docs.reliantlabs.io/guides/hosting/recover-from-bad-deploy.md)
>
> Put the last good release back while the fix is written.

> [card] [Agents in production](https://docs.reliantlabs.io/deep-dives/agents-in-production.md)
>
> How agents operate production safely, and what they never do.

> [card] [Release verdicts](https://docs.reliantlabs.io/deep-dives/how-release-verdicts-work.md)
>
> How a release is judged PASS, FAIL or INCONCLUSIVE.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.