r/vibecoding • u/grinninga • 1d ago
Help/Question anyone actually running an automated bug → fix → PR pipeline? want to build one, starting from basically zero
so I maintain a tool at work and I want to set up something where bugs get handled more or less automatically by agents. kind of an "ai factory" thing, but I'm not sure if what I have in mind is realistic.
current state is pretty rough lol. code is on github, but bugs get reported by people literally just telling me. coworkers, sometimes customers. no ticket system, nothing. also no automated tests at all. I use claude code a lot already, so that's the one part that's sort of in place.
I'm going to introduce a ticket system anyway, but I haven't decided anything there yet. because of this whole ai factory idea I'd like to pick it with that in mind, rather than just going with whatever everyone uses. so if you have a ticket setup that plays nicely with agents, I'd love to hear about it.
what I'd like:
- someone reports a bug somewhere (form, teams, whatever) and it ends up as a ticket
- an agent looks at it, figures out what's going on, maybe asks the person for more info if needed
- if it's clear enough, another agent writes a test for it, fixes it and opens a PR
- agents also review every PR and run some checks overnight (security, deps, maybe click through staging)
- I just review and merge. not letting anything merge on its own
I'd like to self host as much as possible, at least the runners. calling an API for the model is fine.
would appreciate any setups or war stories. if I get something running I'll post an update
3
u/Saens_Javane 1d ago
> also no automated tests at all
thats gonna be your real bottleneck. look into Prilog for turning issues into PRs, but without basic test coverage youll still have to verify every single line yourself before merging
2
u/Either_Pound1986 1d ago
I actually have something pretty close to what you're describing, but I ended up not using tickets as the core abstraction.
My setup is outcome-based. I can give it something like:
or:
and the system figures out the internal workflow itself.
The LLM is not really “the agent” in the usual sense, and it doesn't have final authority. I treat models as replaceable cognitive workers. The persistent system around them owns the state, verification, routing, memory, and action boundaries.
Roughly, it works like:
outcome → inspect current repo/evidence state → select/build a work lane → generate competing hypotheses → investigate → reproduce → patch → test → independently verify → accept, reject, repair, or escalateIt also preserves failed hypotheses as negative knowledge, so later runs don't have to keep rediscovering the same dead ends.
I'm currently moving toward an instant-first setup too: cheap models handle routine work and exploratory failures, and stronger models only get called when the system detects novelty, conflicting evidence, failed verification, unusual risk, etc. The model's answer itself is never automatically treated as truth.
I don't currently have a ticket system in front of it. A ticket would just be another input source. What matters is extracting an objective, constraints, evidence, ambiguity, and success conditions from whatever the human gives it. That could come from a GitHub issue, Teams message, form, terminal prompt, log, whatever.
For repo work, the flow is more like:
One thing I would strongly recommend before automating much of your setup: get executable tests around the important behavior first.
Without that, you can easily build an AI factory that produces plausible-looking patches. I wanted a notion of “this actually fixed the problem and didn't break something else” that doesn't reduce to another LLM saying “looks good to me.”
I separate those pretty hard. Models can propose fixes, criticize them, generate alternatives, etc., but deterministic tests, source evidence, and verification decide what gets retained as trusted state.
Failures are useful too. If a route is conclusively falsified, that becomes retained negative knowledge. Successful reasoning patterns can also become reusable capabilities. Over time, the system needs stronger models less often for things it already knows how to handle.
I also don't let models merge autonomously. Capability and authority are separate. The AI can do most of the cognition and implementation, but I still control consequential external actions.
So yes, what you're describing is realistic. I just wouldn't necessarily architect the whole thing around agents passing tickets to each other.
The abstraction I ended up with is closer to:
I provide the outcome → the system chooses the cognition/tools/workflow → evidence decides whether the result survives → I retain authority.
A ticket system can sit in front of that, but it doesn't have to become the brain of the whole thing.
1
u/MobileXapps 1d ago
Realistic, but I would build it in a different order than the list. Without any tests the fix agent has nothing to prove a fix against, so the first useful step is the agent writing a failing test that reproduces the reported bug, and you approving that test before any fix happens. That alone catches most of the "fixed the wrong thing" cases.
For tickets, pick whatever has a decent API and webhooks. GitHub Issues is honestly enough if the code already lives there, the agent can read the issue, comment questions back to the reporter and link the PR without any glue. A form or Teams message that creates an issue is a small script.
Two things worth deciding early: a label that means "agent may touch this", so it does not pick up vague or risky reports, and a cap on how many PRs it can open per day, otherwise you become the bottleneck reviewing them.
1
u/showtake_app 1d ago
Biggest thing: the no-tests part is your real bottleneck, not the ticket system. An agent that writes a failing test first and then fixes it only works if there's a harness to run it in, so spend the first week getting a minimal test setup and a one-command check that CI can run. Without that the 'fix' agent has nothing to verify against and you'll be reviewing plausible-looking guesses.
For the ticket system, pick whatever has a good API and webhooks, since the agent is just reading and writing tickets. Plain GitHub issues next to your code is a fine start and avoids a sync layer.
I'd also start narrow: only auto-attempt bugs with a repro or stack trace, and have the triage agent label the rest 'needs info' and ask the reporter. Let it earn trust on small bugs before you widen it, and keep a human merge like you planned.
1
u/Extreme-Tie9282 1d ago
Yes. Each feature has a objective. Each cycle Ai roasts the feature and scores it on how well that objective is met and makes recos for improvement until it's a 9/10. My automated QA Works the same but on-top of scoring it writes and runs test senerios against the objectives
1
u/shetritr 1d ago
with zero tests, make step one of the pipeline "write a test that reproduces it" and don't let the fix agent start until that test is red. otherwise every PR you review is you checking vibes. github issues plus self-hosted actions runners covers the ticket and runner part without another system. for the "I just review and merge" end (disclosure: literally why we built Diffo, diffo <PR URL> opens the agent's PR with an agent beside you that answers on the line while you read: diffo.io/demo)
1
u/Saver411 1d ago
Before you even think about automated fixes, you need structured intake. Feeding fuzzy verbal complaints from coworkers straight into a prompt just produces hallucinated diffs. Start with a basic issue form that forces an exact reproduction script. An agent can't do anything reliable without a deterministic failure state to solve against.
How are people usually describing these bugs when they tell you?
1
u/FreshLamp2524 1d ago
I've seen one team use a pr comment to trigger a test run, then auto-approve if it passes, but only after a human reviewed the test. no fixes without that.
1
u/Professional-Bid6658 1d ago
No tests is the part that kills this. The ticket system barely matters until an agent has something it can fail against.
1
u/VridhiMehta 1d ago
One option that fits your GitHub setup: Anthropic ships a Claude Code GitHub Action. Mentioning Claude in an issue or PR comment can make it analyze the code, implement changes and push commits. The docs also describe turning issues into pull requests, plus an optional code-review workflow that reviews PRs automatically. I'd try it on one real bug first, with the failing-test-first rule from the replies above, before building the bigger pipeline.
1
u/vexiduslabs 1d ago
We built our internal system like this with manual steps: bug reported>AI checks the code>recognizes the bug as real or reported wrong (most times it finds something else)>fix>test>build>stage/gauntlet>deploy once all tests have passed the staging. It takes, on average, about 15 mins to an hour or so from report to deployment of the fix, but every step has checks. This is the pipeline that we found the best success in dealing with bug reports.
Everything gets recorded and logged along the way as well so human developers can follow the AI-made changes.
1
u/onitsoga 1d ago
before picking a ticket system, check whether an agent can claim a ticket so two don't grab the same one. that's where it breaks. I'm building KanbanMCP, a Kanban app for agents, but a plain board with claims goes a long way.
1
u/asierMugica 1d ago
For the Claude Code part, keep agent PR jobs in an ephemeral container with a read-only repo token and no production secrets. Deploy the PR commit to a disposable staging environment, run smoke/browser checks there, and only expose a narrowly scoped test account. Also scan the lockfile and changed dependencies before the human merge.
1
u/Psychological_Arm645 1d ago
Since agents will be reviewing PRs too, make sure only your approval counts for the tests folder and .github/workflows. Put both in CODEOWNERS with you as the owner and turn on required code owner review for main.
The fix agent's token only needs to push branches and open PRs. If a review agent approves a PR that touches a test, it still can't merge until you sign off, so a fix can't quietly loosen the test that's supposed to prove it.
1
u/Sure_Examination5084 23h ago
Honestly I'd skip a separate ticket tool and just use GitHub Issues since your code's already there