Factorik Factorik Start free trial
← See all articles

Choosing What Wakes an AI Coding Agent

Quick answer: Choose what wakes an AI coding agent by matching the trigger to the job: an opened issue for a first response, a label for a deliberate hand-off to a fixer, a CI failure for build repair, an opened pull request for review, a schedule for maintenance, and a webhook for signals from outside GitHub such as error alerts. Then guard against noise, strangers on public repositories, and two agents answering the same event.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

What can wake an AI coding agent?

An AI coding agent that only runs when someone remembers to start it is a chat window with extra steps. The point of a standing agent is that it wakes on its own when there is work of its kind, does that work, and goes back to sleep. What wakes it is its trigger, and choosing triggers well matters about as much as writing the agent's job well.

In Factorik, an agent has one job on one GitHub repository, and a person gives it one or more triggers. On the repository, it can wake when an issue is opened, when an issue gets a chosen label, when a comment mentions it, when CI fails on the default branch (and optionally on the team's own pull requests), when a pull request is opened (to review it), and when a change someone marked to watch has merged (to check it in production). Outside the repository, it can wake on a schedule (cron, with a time zone and a task for each run), on an incoming webhook that anything able to call a URL can hit, on a Slack mention, and on "Run now" by hand.

Each trigger carries a different kind of signal. Some say "a person wants something" (a label, a mention), some say "something broke" (a CI failure, a Sentry alert through a webhook), some say "something new needs a look" (an opened issue or pull request), and one says "it is time" (a schedule). The rest of this article goes through them in turn: what each suits, what goes wrong, and an example agent for each.

TriggerSignalFits an agent likeMain pitfall
Issue openedSomething new was reportedIssue TriagerVolume and strangers on public repositories
Issue labeledA person chose to hand it offBug Fixer, Software EngineerLabels used loosely
Comment mentionA person asks this agent, nowAny agent, on demandConversations that drift off the job
CI failingThe build brokeCI FixerFlaky tests read as real failures
Pull request openedA change needs a lookCode ReviewerReviewing the same pull request twice with two agents
Change merged (watched)A marked change is liveChange WatcherChecking too soon
ScheduleIt is timeMaintenance Engineer, Dependency Updater, Production Bug HunterToo frequent, too broad
Incoming webhookSomething outside GitHub happenedBug Fixer from Sentry, Jira or LinearAlert storms
Slack mention or Run nowA person wants it nowAny agentBecoming the only way it runs
Triggers at a glance: the signal each carries and an agent that fits it

Issue opened or issue labeled: which should wake an agent?

"Issue opened" is the widest door you can give an agent. Every new report wakes it, whoever wrote it and however much detail it has. That suits jobs that should touch every issue and are cheap to get slightly wrong: a first response. The Issue Triager preset is built for exactly this. It reads the report, checks the evidence, asks for what is missing and replies with next steps, and it never changes code. A wrong guess costs a comment, not a pull request.

"Issue labeled" is a narrower, deliberate door. Nothing happens until a person, or an automation the team set up, adds the chosen label. That suits jobs where acting on the wrong issue is expensive: a Bug Fixer that writes a failing test and a fix, or a Software Engineer that builds a feature. The label is the team saying "yes, this one". A common pattern is to pair the two: the Issue Triager responds to every new issue, a person reads its reply and adds a label such as agent:fix to the ones worth fixing, and the Bug Fixer wakes on that label.

The pitfall with "issue opened" is volume. A busy repository can send an agent dozens of runs a day, each using sandbox time and each producing something a person may want to read. Use it only for agents whose output is cheap to read. The pitfall with labels is drift: if "bug" is also the label a person uses for sorting, every sorted issue becomes a fix attempt. Give agents labels of their own that mean one thing.

When should CI failures and pull requests wake an agent?

CI failing on the default branch is a strong, unambiguous signal: everyone's work is blocked until it is green again. The CI Fixer preset wakes on it, receives the end of the failed job's log, finds the cause and opens a fix as a pull request at its level. You can also let the trigger fire on the team's own pull requests; there, a CI Fixer only comments with what broke and how to fix it, and does not push to someone else's branch. The page on the CI Fixer agent covers that flow in more detail.

There is a related behaviour that needs no trigger of its own. When CI fails on a pull request an agent opened, that agent fixes it on the same branch, a limited number of times, before a person takes over. So you do not need a CI Fixer watching every agent's pull requests; each agent is responsible for its own.

The main pitfall with CI triggers is flakiness. A test that fails one run in twenty will wake the agent one run in twenty, and a well-behaved agent should recognise a failure it did not cause and say so rather than "fix" it. Every Factorik run is told how CI stands on the default branch, so an agent working on its own change does not take an existing failure on main for its own. Fixing flaky tests is still a job for people, or for a scheduled agent given that task.

"Pull request opened" is the trigger for review. A Code Reviewer reads every new pull request in context, including other agents', and ends with a verdict on the exact commit it read. When it requests changes on an agent's pull request, the author agent answers on the same branch, and auto-merge waits for every reviewer's approval of the current commit. Pull requests from forks are never reviewed. The pitfall here is overlap: two reviewer agents with the same job on the same repository double the comments without doubling the value. If you want two reviewers, give them different jobs, such as a general reviewer and a Security Reviewer focused on one area.

When is a schedule the right trigger?

A schedule suits work nobody reports. Dependencies go out of date without an issue being opened; tests stay missing; documentation drifts from the code; production quietly accumulates errors nobody filed. For these, the trigger is time. In Factorik a schedule is cron with a time zone and a task for each run, so the same agent can be told "update one safe group of dependencies" on Monday mornings and nothing else.

Presets built for schedules include the Maintenance Engineer (one small, safe improvement per run), the Dependency Updater (outdated or vulnerable dependencies, one safe group at a time), the Test Writer, the Docs Keeper, the Performance Engineer, the Security Reviewer and the Production Bug Hunter, which checks production on a schedule and fixes the bug hurting users most. Our article on paying down vibe-coding debt with scheduled agents goes deeper on that rhythm.

The pitfalls are frequency and breadth. An agent that runs every hour produces more pull requests than anyone will read, and review becomes the constraint again. Start with a cadence your team can comfortably review, such as once a day or a few times a week, and keep each run's task narrow. A scheduled agent may also find nothing worth doing; ending with "nothing to do" is a good outcome, not a failure, and it is far better than a change made for the sake of making one.

How do webhooks, watched merges and Slack fit in?

An incoming webhook lets anything that can call a URL wake an agent: a Sentry alert, a Jira or Linear automation, Zapier, or your own application. This is how signals from outside GitHub reach a coding agent. A Sentry alert on a new error can wake a Bug Fixer that reads the error through its connected tools, reproduces it with a failing test and opens a fix. A Linear automation can wake a Software Engineer when an issue moves to a chosen state.

The pitfall with webhooks is alert storms. An error-tracker alert that fires on every occurrence, instead of once per new issue, can wake the agent many times for one bug. Configure the sending side to fire on the event you mean (a new issue, a regression, a state change) and not on every repetition.

The "change merged" trigger wakes a watcher a while after a change someone marked to watch has merged. The Change Watcher preset checks that change in production with the team's tools and never changes code. What it suspects counts only once a person confirms it. The pitfall is checking too soon, before the change has seen real traffic, so give it enough delay to find something.

A Slack mention and "Run now" are the on-demand doors. They are useful for one-off requests and for trying an agent out before giving it standing triggers. The pitfall is letting them become the only way an agent runs: then it is waiting on a person again, and its record grows slowly.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

What goes wrong with agent triggers, and how do I avoid it?

Noise is the first problem. Every run produces something a person may read: a comment, a pull request, a proposal, a "blocked" with a reason. Count the expected runs per week for each trigger before you turn it on, and ask whether someone will read that many outcomes. If not, narrow the trigger (a label instead of every issue) or slow the schedule.

Strangers on public repositories are the second. On a public repository anyone can open an issue or write a comment, and that text reaches the agent. In the "Comment and Control" disclosure, published on April 15, 2026 by researcher Aonan Guan and documented by the Cloud Security Alliance in August 2026, a prompt-injection pattern hidden in GitHub issue or pull request text led AI agents running in GitHub workflows from several vendors to expose CI secrets. In Factorik, people outside the team do not start agents on a public repository unless the trigger allows anyone, and text from issues and comments is treated as data, not instructions. Leave the default alone unless the agent's job is to answer the public, as an Issue Triager on an open-source project might be.

Overlapping agents are the third. Two agents woken by the same event with similar jobs will step on each other: duplicate comments, competing pull requests, merge conflicts. A 2026 preprint studying concurrently running coding agents found that identical agent instances hit a 19.8% textual merge conflict rate. Give each agent one job and its own trigger, and when two must share a trigger, make sure their jobs do not touch the same files or the same outcome.

What does a sensible set of triggers look like for one repository?

Here is an illustration, not a customer story: a team running a public web application in the repository acme/storefront, starting small.

First, an Issue Triager wakes on "issue opened", with the trigger set to allow anyone, because its job is answering the public. It reads a new issue titled "Checkout button does nothing on Safari 18", asks for the browser console output and the steps to reproduce, and replies with next steps. It changes no code.

Second, a person reads the triage reply, sees a clear reproduction in the follow-up, and adds the label agent:fix. A Bug Fixer wakes on that label; its trigger is left at the default, so only the team starts it. It writes a failing test in tests/checkout/submit.spec.ts, fixes the event handler in src/checkout/SubmitButton.tsx and opens a pull request.

Third, a Code Reviewer wakes on "pull request opened", reads the change in context and requests one change: the fix should also cover the keyboard path. The Bug Fixer answers on the same branch, and the reviewer approves the new commit.

Fourth, checks pass. The Bug Fixer works at the first level, so a person merges it. Its record grows by one merged change.

Fifth, separately, a CI Fixer wakes when the default branch goes red after an unrelated merge, and a Dependency Updater runs on a Monday morning schedule with the task "one safe group of outdated dependencies". Neither overlaps with the others: each has one job and its own trigger.

How do I start choosing triggers for my own agents?

Start with two or three agents whose triggers carry strong signals and cheap mistakes: a CI Fixer on CI failures, an Issue Triager on opened issues, and a scheduled Dependency Updater. Keep every agent at the first level, where a person merges what it opens, and watch how many runs each trigger starts and how many of their outcomes you actually use. Narrow what is noisy, add a labeled Bug Fixer when triage is going well, and let each agent's record decide when it earns more.

You can set this up on your own repository with a free 7-day trial of the Team plan, with no payment details needed.

Frequently asked questions

What is an AI coding agent trigger?

A trigger is the event that wakes a standing agent to do its job: an issue opened or labeled, a comment mentioning it, CI failing, a pull request opened, a schedule, an incoming webhook, a Slack mention, or a person pressing Run now. Choosing it well decides how often the agent runs and on what.

Should a bug-fixing agent run on every new issue?

Usually not. Every new issue includes duplicates, questions and reports without enough detail. A common pattern is a triage agent on every new issue and a fixing agent on a label a person adds once the issue is worth fixing.

Can strangers trigger my agent on a public repository?

In Factorik, not by default. On a public repository, people outside the team do not start agents unless the trigger allows anyone. Leave that off unless the agent's job is to answer the public, such as triaging issues on an open-source project.

How often should a scheduled agent run?

As often as your team can comfortably review what it produces, and no more. Once a day or a few times a week is a good start for maintenance work, with a narrow task for each run. Ending with nothing to do is a fine outcome.

Can I wake an agent from Sentry, Jira or Linear?

Yes, through an incoming webhook: anything that can call a URL can wake an agent. Configure the sending side to fire once per new issue or state change rather than on every occurrence, so one bug does not start many runs.

What happens if two agents react to the same event?

Both run, and if their jobs overlap they can produce duplicate comments or conflicting changes. Give each agent one job and its own trigger, and make sure agents that share a trigger work on different things.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

How helpful was this article?

Articles by Factorik →