Creating pull requests for errors with AI SRE

Enable AI SRE to read your code, write fixes, and open pull requests by connecting the GitHub integration.

Who is the author?

Pull requests are opened by the Better Stack GitHub App, not on your behalf.

Create pull requests for errors

Fix bugs directly in Better Stack with just one click.

In Errors, find an error you want to fix and click Create pull request:

Create pull request button in Error

AI SRE opens a new chat and begins the process automatically:

  1. It starts with the full error context, including the stack trace, breadcrumbs, and occurrence counts.
  2. Clones the linked GitHub repository into a fresh sandbox environment. AI SRE runs in an isolated environment for each conversation. Your code is only accessible to that conversation and is wiped when it ends.
  3. Creates a new branch named ai‑sre/fix‑<short‑hash>‑<random>.
  4. Investigates the error by reading the relevant files and traces it to its root cause.
  5. Writes and validates a minimum‑viable fix.
  6. Opens a pull request with a clear title and a description linking back to the error and the AI SRE conversation.

The chat stays open for follow-ups

AI SRE will autonomously submit a pull request. Send messages to the chat to ask for changes, additional adjustments, or clarification.

Pull request creation in chat

The new pull request is automatically linked to the error pattern in Better Stack, so anyone viewing the error can see a fix is in progress.

Pull request example

Fix errors in any AI SRE chat

Fixing errors and working with GitHub works in any chat. Ask AI SRE to:

  • Fix errors in your applications.
  • List repositories connected to your team.
  • Clone a specific repository by name or by the source it's linked to.
  • Read and edit files inside the sandboxed environment.
  • Open a pull request with the changes when you are ready.

Each step appears as a collapsible card in the chat, so you can see exactly what the agent is doing.