Skip to content

Features

AI Autofix: from an error to a pull request

Run an AI agent on an issue. It reads the captured error, explores your repository, works out the root cause and, when the bug can be fixed in your code, opens a draft pull request for you to review. When you only need the diagnosis, run an investigation instead.

All Buglapse features

Autofix·WEB-42
AI agentClaude · your key Pull request opened
  1. Root cause12s

    coupons.find() returns undefined for an unknown code, and applyCoupon reads coupon.id without a check.

  2. Plan8s

    Guard the missing coupon, throw CouponNotFoundError and show the message in CheckoutForm.

  3. Changes+2 −1

    1 file changed in src/checkout.

  4. Draft PR#128

    Draft pull request #128 opened on a new branch.

acme/acme-web#128
Draft

fix(checkout): guard missing coupon in applyCoupon

Buglapse-autofix wants to merge 1 commit into main from buglapse/autofix-web-42

src/checkout/useCart.ts+2 −1
46 export function applyCoupon(cart: Cart, code: string) {
47 const coupon = cart.coupons.find(c => c.code === code)
48- return pricing.discount(cart.total, coupon.id)
48+ if (!coupon) throw new CouponNotFoundError(code)
49+ return pricing.discount(cart.total, coupon.id)
50 }

AI Autofix

A fix you review, not a suggestion you copy

  • A real pull request

    The result is a draft pull request on GitHub or a draft merge request on GitLab, on a new branch, with the full diff also visible in Buglapse.

  • Your own AI provider key

    Autofix runs on your Anthropic, OpenAI or OpenAI-compatible key. You pay the provider directly and Buglapse adds no markup on tokens.

  • Reads code, never runs it

    The agent can read and edit files in the linked repository only. It cannot run your code, your tests or shell commands, and never pushes to an existing branch.

  • Every step is visible

    The root cause, the plan, the changes and the pull request are logged step by step, so you can see how the agent got to the fix.

How it works

Set up once, run on any issue

  1. 1

    Connect a repository and a provider

    The organization owner connects GitHub or GitLab and an AI provider, then links a repository to the project.

  2. 2

    Run Autofix on an issue

    Any member can start a run from the issue page: Investigate for a diagnosis, Autofix for a pull request. The agent explains its plan before it writes the patch and asks the team when it is unsure.

  3. 3

    Review the draft

    Open the pull request, read the diff and merge it like any other change — or close it if the fix is not what you want.

In detail

How the agent works

Root cause, plan, changes, pull request

The agent starts from what Buglapse already knows: the stack trace, the breadcrumbs, the release and the code around the failing line. While it looks for the cause it can also ask Buglapse for other occurrences of the same issue and for the affected user. It is given the steps to the error as well: chains of actions that many occurrences went through in the same order, so the trigger is not guessed from a single session. It explores the repository to find where the problem really comes from, explains what it is going to change and why, and only then writes the patch. Every fix lands on a new branch as a draft, and if your CI fails on it the agent can try to repair its own change, up to the number of attempts your plan allows. Per-project instructions let you tell it which folders to touch and which style to follow.

Investigate: a diagnosis without a pull request

An investigation is a shorter, cheaper run that stops at the root cause. The agent names the stack frame where things go wrong, what the user or the system did right before, and when and for whom it happens: a release, an environment, a tag value. It needs only an AI provider, so it works on a project with no linked repository too. The diagnosis ends with a recommendation: hand the issue to Autofix, which continues the same run, or take it locally. For the second case Buglapse prepares a prompt for the coding agent on your machine, with the diagnosis and the error report inside.

The agent picks the route, the team can step in

Once the cause is found, the agent decides how to go on. A simple fix skips the plan and goes straight to the patch. A risky one — a change to public behaviour, an API, a schema, stored data or security, or a cause the agent is not sure about — waits until someone on the team reads the plan and continues, corrects or cancels it. Before the pull request is opened the agent can ask the team a question and wait for the answer, and any member can write to it while it works. A waiting run raises an alert, so the question is not missed.

After the pull request

Buglapse keeps watching the pull request. When CI fails on the agent's change, the agent reads the failed checks and pushes a repair to the same branch; checks that already fail on the base branch do not count, and if someone else pushes to the branch the agent stops. When you merge, the issue is resolved for you. Then the fix is verified: if the error does not come back within seven days of the next release, the fix is marked verified, and if it does, the run shows the release it came back in. Project and organization statistics show how many runs ended in a pull request, were merged and were verified.

Providers and models

The provider and the model are chosen once for the organization, the instructions per project: Claude from Anthropic, the models your OpenAI key can access, or any server with an OpenAI-compatible Chat Completions API. That includes hosted services such as OpenRouter, DeepSeek and Groq and model servers of your own such as Ollama and vLLM, in which case the code never leaves your network.

On each plan

Compare all plans
On each plan
Free Pro Team
AI agents (Autofix)Not includedIncludedIncluded
Autofix runs / monthNot included30Unlimited
CI-fix attempts per runNot included35
Investigate (diagnosis without a pull request)IncludedIncludedIncluded
Investigations / month10100Unlimited

FAQ

Common questions

Still have questions?

Drop us a line — we'll help with setup, plans or self-hosting.

Contact us

or email hello@buglapse.com

How much does Autofix cost?
Tokens are billed by your AI provider on your own key. Buglapse limits only the number of Autofix runs and investigations per month, which depends on the plan — see the table above. Repairs after a failed CI are part of the run and are not counted separately.
What access does the agent have to my code?
It reads and edits files in the repository linked to the project and opens a draft pull request. It does not execute code and has no access to anything outside that repository.
Does it run on every error automatically?
No. A run is started by a member of the team on a specific issue, so you decide which bugs are worth an agent's time.
Can I use it without connecting a repository?
An investigation, yes: it needs only an AI provider and diagnoses the issue from the stack trace with the source lines around each frame. A pull request needs a repository linked to the project.
What if the cause is not in my code?
Then the run ends with a report instead of a pull request: what to do about it, how to live with it until then and, when it makes sense, an offer to add a safeguard to your own code. The safeguard is a regular draft pull request, opened only if you agree.

See also

Error tracking

Every error grouped into one issue with a readable stack trace, breadcrumbs, the steps to the error and the affected users.

Learn more: Error tracking

MCP server

Let Claude Code, Cursor and other AI assistants read your issues, traces and logs.

Learn more: MCP server

Ready to see what's happening in your app?

Create a project on the free plan and send your first event in a couple of minutes.

Still have questions? Email hello@buglapse.com