<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sergiy Dybskiy</title>
    <description>The latest articles on DEV Community by Sergiy Dybskiy (@sergical).</description>
    <link>https://dev.to/sergical</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3953361%2Fb181fe5e-334c-4297-a081-54d48ebe515f.jpeg</url>
      <title>DEV Community: Sergiy Dybskiy</title>
      <link>https://dev.to/sergical</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sergical"/>
    <language>en</language>
    <item>
      <title>Your agent can't fix what it can't see</title>
      <dc:creator>Sergiy Dybskiy</dc:creator>
      <pubDate>Thu, 28 May 2026 14:04:58 +0000</pubDate>
      <link>https://dev.to/sentry/your-agent-cant-fix-what-it-cant-see-4391</link>
      <guid>https://dev.to/sentry/your-agent-cant-fix-what-it-cant-see-4391</guid>
      <description>&lt;p&gt;Agents are getting better and better at fixing bugs. They’re even getting better at testing their work, thanks to headless browsers, sandboxes, simulators, etc.&lt;/p&gt;

&lt;p&gt;But what about the bugs that only show up once you bring in different browsers, languages, extensions, internet speeds, and all the other variables that get mixed in the second you ship to prod? Or all the bugs that only show up when you account for… well, humans being humans and doing weird stuff you didn’t expect them to do?&lt;/p&gt;

&lt;p&gt;The bottleneck for self-healing software isn’t agent intelligence. It’s that agents have no idea what actually broke. They’re debugging from source code alone, which is roughly as effective as diagnosing a server outage by skimming the README. What they’re missing is production context: the stack trace, the request payload, the environment, the breadcrumbs leading up to the failure.&lt;/p&gt;

&lt;p&gt;Your agents need someone/something telling them what’s breaking in the wild &lt;em&gt;and&lt;/em&gt; giving them the context they need to understand why.&lt;/p&gt;

&lt;p&gt;We built &lt;a href="https://mcp.sentry.dev/" rel="noopener noreferrer"&gt;Sentry MCP&lt;/a&gt; and the &lt;a href="https://cli.sentry.dev/" rel="noopener noreferrer"&gt;Sentry CLI&lt;/a&gt; to make that context available to both humans, and increasingly as important, their agents. You can wire up a system today where a Sentry alert triggers an agent, the agent investigates the issue using the same evidence you would, and a draft PR with a fix lands in your repo before you open a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why draft PRs, not auto-merge
&lt;/h2&gt;

&lt;p&gt;Let’s be honest about what’s realistic. A system that detects, fixes, tests, deploys, and monitors its own patches without human involvement is not something you should build today. That’s how you get a very exciting incident review.&lt;/p&gt;

&lt;p&gt;The useful version is more modest: a production error fires, an agent investigates it with real Sentry context, writes a small fix with a regression test, and opens a draft PR. A human is very much in the loop.&lt;/p&gt;

&lt;p&gt;That’s not fully autonomous, but it’s not trivial either. Most bugs sit in a queue, triaged, prioritized, assigned, waiting, and often lose out to new features. Seer diagnoses the root cause in under two minutes. A complete Autofix run, from root cause analysis to an opened PR, takes about six minutes.&lt;/p&gt;

&lt;p&gt;An agent that opens a reviewable, mergeable fix six minutes after the error fires is a meaningful change to your mean time to resolution, even if a human still clicks merge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways to give your agent production context
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sentry MCP&lt;/strong&gt; is the right choice for agents that support the Model Context Protocol (Claude Code, Cursor, Codex, Windsurf, VS Code with Copilot). Your agent connects to the hosted server, authenticates via OAuth, and gets structured access to issues, events, traces, and Seer analysis. No local install required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# One-liner for any MCP-compatible client&lt;/span&gt;
npx add-mcp https://mcp.sentry.dev/mcp

&lt;span class="c"&gt;# Or for Claude Code specifically&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http sentry https://mcp.sentry.dev/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your client doesn’t support the one-liner, add the config manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sentry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://mcp.sentry.dev/mcp"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Sentry CLI&lt;/strong&gt; is the right choice for scripted workflows, CI pipelines, or any automation where you need structured output you can pipe to &lt;code&gt;jq&lt;/code&gt; or feed into another process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://cli.sentry.dev/install &lt;span class="nt"&gt;-fsS&lt;/span&gt; | bash
sentry auth login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s what that looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sentry issue list

Issues &lt;span class="k"&gt;in &lt;/span&gt;acme/checkout:
╭──────────────┬──────────────────────────────────────────────────────┬──────┬─────┬────────┬───────┬──────────────╮
│ SHORT ID     │ ISSUE                                                │ SEEN │ AGE │ EVENTS │ USERS │ TRIAGE       │
├──────────────┼──────────────────────────────────────────────────────┼──────┼─────┼────────┼───────┼──────────────┤
│ CHECKOUT-P1  │ TimeoutError: Payment charge exceeded 30s            │   3h │  3h │  1.8k  │   340 │ High  86%    │
├──────────────┼──────────────────────────────────────────────────────┼──────┼─────┼────────┼───────┼──────────────┤
│ CHECKOUT-N7  │ TypeError: Cannot &lt;span class="nb"&gt;read &lt;/span&gt;property &lt;span class="s1"&gt;'total'&lt;/span&gt;              │   1d │  5d │    215 │    82 │ High  71%    │
├──────────────┼──────────────────────────────────────────────────────┼──────┼─────┼────────┼───────┼──────────────┤
│ API-34       │ RateLimitError: Too many requests to /v1/charges     │   3d │ 21d │     67 │    24 │ Med   42%    │
╰──────────────┴──────────────────────────────────────────────────────┴──────┴─────┴────────┴───────┴──────────────╯
Tip: Use &lt;span class="s1"&gt;'sentry issue view &amp;lt;ID&amp;gt;'&lt;/span&gt; to view details.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CHECKOUT-P1&lt;/code&gt; is at the top, a timeout in the checkout service with 1.8k events and an 86% fixability score. Drill in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sentry issue view CHECKOUT-P1

CHECKOUT-P1: TimeoutError: Payment charge exceeded 30s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭────────────┬─────────────────────────────────────────────╮
│ Status     │ ● Unresolved &lt;span class="o"&gt;(&lt;/span&gt;Ongoing&lt;span class="o"&gt;)&lt;/span&gt;                      │
│ Fixability │ High &lt;span class="o"&gt;(&lt;/span&gt;86%&lt;span class="o"&gt;)&lt;/span&gt;                                  │
│ Level      │ error                                       │
│ Platform   │ node                                        │
│ Project    │ checkout-service                            │
│ Events     │ 1832                                        │
│ Users      │ 340                                         │
│ First seen │ 3 hours ago                                 │
│ Last seen  │ 12 minutes ago                              │
│ Culprit    │ chargeCustomer &lt;span class="o"&gt;(&lt;/span&gt;src/payment.ts&lt;span class="o"&gt;)&lt;/span&gt;             │
│ Link       │ https://acme.sentry.io/issues/CHECKOUT-P1/  │
╰────────────┴─────────────────────────────────────────────╯

Tip: Use &lt;span class="s1"&gt;'sentry issue explain CHECKOUT-P1'&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;AI root cause analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks like a straightforward timeout. An agent with just this would add retry logic or bump the timeout. But run &lt;code&gt;sentry issue explain&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sentry issue explain CHECKOUT-P1

ℹ Starting root cause analysis, it can take several minutes...

Root Cause Analysis Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Cause &lt;span class="c"&gt;#0: The checkout service's /charge endpoint times out&lt;/span&gt;
waiting &lt;span class="k"&gt;for &lt;/span&gt;the payment service, which blocks on an inventory
availability check. The inventory service&lt;span class="s1"&gt;'s check_stock query
regressed from ~200ms to ~28s after migration
0047_drop_unused_indexes removed the compound index on
(product_id, warehouse_id).

Repository: acme/inventory-service
Affected: src/queries/check_stock.ts:18
First seen: release-3.1.0 (deployed 3h ago)

Reproduction steps:
1. User submits checkout → POST /charge
2. Payment service calls inventory.check_stock(items)
3. check_stock runs full table scan (missing index) → 28s
4. Payment call exceeds 30s timeout → TimeoutError bubbles up to checkout

To create a plan, run: sentry issue plan CHECKOUT-P1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The root cause isn’t in the checkout service at all. It’s a dropped database index in the inventory service, two hops away in the trace. No amount of retry logic in &lt;code&gt;payment.ts&lt;/code&gt; fixes that.&lt;/p&gt;

&lt;h2&gt;
  
  
  From alert to draft PR
&lt;/h2&gt;

&lt;p&gt;When a Sentry alert fires on a new or regressed issue, a webhook triggers a worker that checks out your repo and runs a coding agent with a prompt grounded in the specific issue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A production error was captured by Sentry. The issue ID is CHECKOUT-P1.

Use Sentry MCP to retrieve the full issue details: stack trace,
breadcrumbs, tags, release, environment, distributed traces,
suspect commits, and Seer analysis.

Based on the evidence:

1. Identify the root cause. Follow traces across services.
2. Make the smallest safe fix in the right repository.
3. Add or update a regression test that covers this failure.
4. Run the test suite.
5. Open a draft PR with the Sentry issue link, root-cause
   summary, files changed, and test results.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent pulls the issue via MCP. The distributed trace shows the checkout call chaining through the payment service into an inventory check that’s taking 28 seconds. Metrics confirm the inventory service’s p99 spiked from 200ms to 28s three hours ago. Suspect commits point at a migration in &lt;code&gt;acme/inventory-service&lt;/code&gt; that dropped a compound index. Session replay shows users rage-clicking “Pay” while nothing happens, generating duplicate charge attempts.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sentry issue plan CHECKOUT-P1&lt;/code&gt; lays out the fix: restore the compound index on &lt;code&gt;(product_id, warehouse_id)&lt;/code&gt;. A draft PR lands in &lt;code&gt;acme/inventory-service&lt;/code&gt; with the migration, a root-cause summary linking back to the Sentry trace, and a regression test.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.sentry.io%2F_vercel%2Fimage%3Furl%3D_astro%252Fsentry-self-healing-loop-diagram.BgBqAHWo.png%26w%3D828%26q%3D100" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.sentry.io%2F_vercel%2Fimage%3Furl%3D_astro%252Fsentry-self-healing-loop-diagram.BgBqAHWo.png%26w%3D828%26q%3D100" alt="Self-healing loop: production error flows to Sentry for context and root cause, triggers a coding agent that opens a draft PR, human reviews and merges the fix" width="828" height="669"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it with Cursor Automations
&lt;/h2&gt;

&lt;p&gt;We publish a &lt;a href="https://sentry.io/cookbook/regressed-issue-to-pr-cursor/" rel="noopener noreferrer"&gt;cookbook recipe&lt;/a&gt; for this exact workflow using Cursor’s Automations feature. It walks through connecting your repo to Sentry, adding the MCP server to an automation, and configuring a webhook alert to trigger on regressed issues.&lt;/p&gt;

&lt;p&gt;Because Sentry knows the release history and suspect commits, the agent doesn’t search the entire repo for the problem. It starts where the evidence points. For regressed issues specifically, it can identify which commit reintroduced the bug, read the original fix, and understand what went wrong the second time around.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next
&lt;/h2&gt;

&lt;p&gt;The more telemetry your app sends to Sentry (traces, metrics, logs, session replays), the harder the bugs an agent can tackle. Today it’s dropped indexes across service boundaries. Six months ago it was null checks. The merge rate on Autofix PRs has climbed from 41% to 46% in that time, and the diagnosis complexity is growing with it.&lt;/p&gt;

&lt;p&gt;There are real limits. Bugs that need product judgment, issues in code the agent can’t reach, and problems where there isn’t enough telemetry to connect the dots: those still need you. But the surface area of what agents can fix is expanding every month.&lt;/p&gt;

&lt;p&gt;Connect &lt;a href="https://mcp.sentry.dev/" rel="noopener noreferrer"&gt;Sentry MCP&lt;/a&gt; to your editor or install the &lt;a href="https://cli.sentry.dev" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;. Hook up your repos for code mappings and tracing. Run &lt;code&gt;sentry issue explain&lt;/code&gt; on something that’s been sitting in your backlog and see what it finds.&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://docs.sentry.io/product/ai-in-sentry/seer/autofix/" rel="noopener noreferrer"&gt;Seer Autofix docs&lt;/a&gt; for more on coding agent handoff to Claude Code and Cursor.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was originally published on the &lt;a href="https://blog.sentry.io/agents-need-production-context/" rel="noopener noreferrer"&gt;Sentry Blog&lt;/a&gt; by &lt;a href="https://blog.sentry.io/authors/sergiy-dybskiy/" rel="noopener noreferrer"&gt;Sergiy Dybskiy&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
