# Teaching an agent to auto-fix bugs

DevFeed: [Teaching an agent to auto-fix bugs](<https://devfeed.tech/articles/teaching-an-agent-to-auto-fix-bugs-83561.md>)

Original publisher: [Read original article](<https://linear.app/now/linear-agent-bug-fix>)

Published: 2026-06-12T16:34:00Z

Content type: article

Language: en

Sources: [Linear](<https://devfeed.tech/sources/linear.md>)

Topics: [Linear](<https://devfeed.tech/topics/linear.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [bugfixes](<https://devfeed.tech/topics/bugfixes.md>), [workflow automation](<https://devfeed.tech/topics/workflow-automation.md>), [ai code review](<https://devfeed.tech/topics/ai-code-review.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [automation](<https://devfeed.tech/tags/automation.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [datadog](<https://devfeed.tech/tags/datadog.md>), [linear](<https://devfeed.tech/tags/linear.md>), [tasks](<https://devfeed.tech/tags/tasks.md>), [triage](<https://devfeed.tech/tags/triage.md>), [types](<https://devfeed.tech/tags/types.md>)

## AI overview

A Linear engineer describes automating bug triage with Linear Agent. The agent handles well-scoped dead feature flag cleanup reliably, while fixes for variable background task failures succeed less often; added gates reduce unsuitable pull requests, and the agent can still investigate issues it cannot fix. The article emphasizes providing task context through workflow skills, automation rules, code conventions, and review.

## Source excerpt

I was very skeptical of AI to begin with. Part of me suspected the technology wasn't as capable as the hype would suggest, while another part was deeply worried that it was far more capable than I wanted to admit. But the closer I got to the technology the more those worries started to fade. The tech is very capable, but when you work with it you start to realise the extent of that capability. Where it's strong, where it's weak, and how the engineering role is evolving to fit the spaces between them. I've spent the majority of my time over the past few months building out automations in Linear. When combined with the Linear Agent, which can read and write code, and take actions in your workspace, you get an outcome that's close to what we described last year as "Self-driving SaaS". Software that can do things in the background on your behalf, moving work forward, guided by rules and gates rather than a human hand. How much it can own from start to finish varies enormously depending on how your team works and what your codebase looks like, it's not a fixed property of the technology. We've had to experiment a lot to find the edges of that capability and then work back. An automation I've been experimenting with lately is getting the Linear Agent to auto-fix bugs that land in triage. When we first tried this workflow we had the agent attempt a first pass at all the bugs coming in. That didn't work very well because there wasn't enough context to one-shot the fix, so we had to narrow the ask and feed it the right instructions and tools. There are two types of issues that the agent is good at fixing on the first pass in our workspace today: catching dead feature flags and patching up failing background tasks. Automations I've been building Through our Datadog integration, a monitor catches the problem and files an issue into triage, where an automation assigns it to the Linear Agent to pick up, run the relevant skill, and take a pass. Dead feature flags are the cleaner