This post continues “The Centaur’s Toolkit” series on practical human-AI collaboration in technical work.


The error showed up in production on a Wednesday afternoon.

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

I knew this error. Or thought I did. Stack Overflow had dozens of answers: upgrade psycopg2, check your SSL certificates, adjust your connection timeout. I’d even hit this error two years earlier on a different project, and the fix had been a connection pool configuration change.

I made the same change. The error came back six hours later.

The Stack Overflow answers weren’t wrong. They just weren’t answering my question. My question wasn’t “what causes SSL SYSCALL errors in psycopg2.” My question was “why is this happening in this environment, after running fine for three months, at this specific load level?”

That distinction is the difference between Stack Overflow debugging and AI debugging. Stack Overflow matches your error to other people’s errors. AI reasons about your specific situation.

The Stack Overflow Model and Its Limits

Stack Overflow is genuinely excellent at what it does. If you have a common error that many developers have hit before, there’s probably a highly-voted answer that solves your exact problem.

But debugging doesn’t always work that way. The edges are where it breaks down.

Version mismatches. An answer from 2022 might not apply to the library version you’re running today. Methods change, behaviors change, defaults change. You’re searching for the error message, but the root cause is different.

Context-dependent behavior. Your error might share a message with a hundred Stack Overflow posts but have a completely different cause. AttributeError: 'NoneType' object has no attribute in Python can stem from dozens of different code paths. The right answer depends on your specific situation.

Novel combinations. You’re using Library A with Library B, but all the answers are about Library A with Library C. The interaction behaviors differ and the answers don’t transfer cleanly.

Intermittent issues. Nobody posts “my service fails about 2% of requests under load with no consistent stack trace.” There’s no clean reproduction case to search. Stack Overflow helps with concrete errors; it doesn’t help you reason about probabilistic failure modes.

This is where the conversational nature of AI debugging becomes useful in a way that search fundamentally can’t replicate.

What AI Does Differently

When you paste an error into a Stack Overflow search, you’re matching text. When you describe a problem to an AI, something different happens: you get a diagnostic conversation.

The AI holds context across the conversation. You don’t have to start over when you add new information. You can say “I tried that, and here’s what happened” and the next suggestion builds on the previous exchange rather than starting fresh.

The AI can ask clarifying questions. “Is this happening under all traffic levels or only at peak?” “What version of the library are you running?” “Is this a fresh deployment or has it worked before?” These questions narrow the problem space in ways that search can’t.

The AI can explain the underlying mechanism, not just “add this configuration parameter” but “here’s why that parameter matters for your specific situation.” Understanding the why helps you avoid the next variation of the same problem.

Back to my Wednesday afternoon: when I described the full situation to Claude, including the three months of stable operation, the recent infrastructure migration, the load correlation, and the timing pattern, the first response didn’t give me a fix. It asked two questions: had anything changed in the database infrastructure recently, and what was the connection pool size relative to the observed peak concurrent connections?

The infrastructure team had migrated to a new database cluster eight days earlier. The connection pool was sized for average load, not for peak. Under heavy traffic, the pool was exhausting; connections were timing out; the timeout manifested as an SSL error because of how psycopg2 handles forced connection termination.

Stack Overflow didn’t have my bug. It had symptoms that looked like my bug.

A Debugging Framework for AI

The difference between effective and ineffective AI debugging is mostly about how you frame the problem.

Start with the Scene, Not the Error

The worst way to begin an AI debugging session: paste the error message and ask “what’s wrong?”

You’ll get a generic answer about common causes. You could have gotten that from Stack Overflow.

Instead, set the scene before you share the error:

I'm debugging a production issue with a FastAPI service (Python 3.12,
FastAPI 0.115, SQLAlchemy 2.0) that's been running stably for three
months. About eight days ago we started seeing intermittent 500 errors
under load. They correlate with peak traffic (above roughly 800
concurrent requests) but don't happen every time.

The service connects to PostgreSQL 15 via SQLAlchemy async engine.
Connection pool is pool_size=5, max_overflow=10.

Here's the error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

That context changes everything. The AI now knows the deployment history, when the failure occurs, the technical stack with versions, and the specific configuration. Compare the quality of suggestions you’d get from this versus a raw error paste.

State What You’ve Already Tried

Nothing is more frustrating than receiving a suggestion you’ve already ruled out. Head this off explicitly:

I've already tried:
- Upgrading psycopg2 from 2.9.7 to 2.9.9 (no change)
- Increasing connection timeout to 60s (no change)
- Adding sslmode=require to the connection string (no change)

I haven't adjusted the pool size because I wasn't sure it was related,
but I'm starting to think it might be.

This focuses the AI on unexplored territory and signals what you’ve already eliminated.

Be a Detective, Not a Petitioner

The temptation is to ask: “How do I fix this?”

The better question: “Help me understand what’s happening.”

There’s a subtle difference that matters. When you ask for a fix, you get a solution. When you ask for understanding, you get a diagnostic partner.

I’ve had debugging sessions where the AI’s explanation revealed three separate problems layered on top of each other. The immediate fix addressed only one of them. Knowing about the others meant I could address them proactively rather than discover them as separate production incidents later.

Follow the “Why” Chain

When the AI explains a cause, follow up with “why.” Keep going until you reach the level of understanding you need.

You: Why would pool exhaustion cause an SSL error?

AI: When a connection times out from the pool's perspective, the client
    closes the connection. If there's an in-flight transaction from the
    database's perspective, the server-side SSL session gets terminated
    abruptly. This manifests as "EOF detected" on the client rather than
    a clean timeout error.

You: So the SSL error is a symptom, not the actual problem?

AI: Exactly. The actual problem is connection pool exhaustion. The SSL
    error is what you observe when a pooled connection gets forcibly
    closed mid-request.

Without this chain, I would have kept chasing SSL configuration. The error was real; the SSL layer just wasn’t where the problem lived.

What AI Debugs Well

Runtime errors with context. If you can describe what the code was doing when it failed, what the inputs were, and what environment it was running in, AI handles this well. The more context you provide, the better.

Configuration issues. “I changed X and now Y is broken” is exactly the causal relationship AI handles effectively, especially when you provide both the before and after state.

Performance problems. Describe what’s slow, what the load pattern looks like, and what you’ve measured. AI can often suggest what to measure next and which mechanisms are likely responsible.

Logic errors in familiar domains. If you can show the code and describe expected versus actual behavior, AI is good at spotting gaps, particularly for common algorithmic and data-handling mistakes.

Dependency and compatibility issues. “I upgraded from version X to Y and this broke” is a well-structured problem that AI handles reasonably, assuming the version change falls within its training data.

What AI Debugs Poorly

Bleeding-edge library versions. If you’re running a version released recently, the AI may not know about behavior changes. Always verify suggestions against current documentation when working with recent releases. The trust calibration framework from Part 3 applies directly here.

Hardware and driver issues. Kernel-level problems, GPU driver interactions, and hardware-specific behaviors require vendor documentation and tooling that AI doesn’t have real context about.

Intermittent issues without data. “It fails sometimes” isn’t enough information for anyone, including AI. You need logs, metrics, or a reliable reproduction case. AI can help you figure out what to measure; it can’t diagnose based on “it sometimes doesn’t work.”

Security vulnerabilities. AI can suggest what might be a vulnerability and explain the mechanism, but never rely solely on it to assess security correctness. The stakes are too high and the failure modes too subtle. This is one of the cases where you go to authoritative sources directly.

Issues requiring source-level investigation. If the bug lives in a library’s internals, you eventually need to read the source. AI can help you understand what to look for, but at some point you need to look.

The Explain-the-Bug Technique

One of the most useful patterns I’ve found: don’t ask the AI to fix your bug. Ask it to explain the bug.

I'm not asking you to fix this yet. I want to understand it first.

Can you explain, step by step, what's happening mechanically when
this error occurs? Walk me through what the code does, where it
goes wrong, and what state the system is in when the error fires.

This changes the output from “here’s a solution” to “here’s an explanation.” The explanation often reveals that the fix you were about to apply would have addressed the symptom without touching the cause.

It also gives you something to evaluate. If the AI’s explanation doesn’t match your understanding of how the system works, that’s a signal to dig deeper rather than apply the suggested fix.

Avoiding the Patch Trap

AI will almost always give you a fix. The fix will often work, at least for the immediate manifestation of the problem.

This is a trap.

A patch that makes the error go away without addressing the root cause is technical debt with a fuse. You’ve hidden the problem; you haven’t solved it.

The discipline is to ask: “If I apply this fix, what am I actually changing about the system? Does that address what caused the problem, or does it just suppress the symptom?”

In the connection pool example, simply increasing pool_size and max_overflow would have stopped the immediate errors. But the underlying issue was that we hadn’t characterized the actual connection demand of the service under peak traffic. Increasing the pool without understanding the demand pattern just pushes the failure threshold to a higher traffic level.

The real fix was: instrument connection usage, understand actual peak demand, size the pool with appropriate margin, and add monitoring to see warning signs before the next failure. AI suggested all of this once I stopped asking “how do I fix the error” and started asking “help me understand why connections are being exhausted.”

Putting It Together: A Debugging Session Structure

When I sit down to debug something genuinely difficult, here’s how I structure the AI session:

  1. Scene-setting (2-3 sentences on what the system is and what’s changed recently)
  2. Symptom description (when it fails, how often, under what conditions)
  3. What I’ve tried (explicit list so we don’t retread ground)
  4. The error (full stack trace, not just the last line)
  5. Ask for explanation, not fix (“help me understand what’s happening”)
  6. Follow the why chain until I reach the root cause
  7. Only then ask for fix options (plural, so I understand the tradeoffs)

This takes a few more minutes than “paste error, ask for fix.” It produces solutions that actually hold.


What’s your go-to approach when a difficult bug resists the obvious solutions? Do you reach for AI immediately, or work through it yourself first? I’m curious how this is evolving for people. Find me on X or LinkedIn.


What’s Next

We’ve built a toolkit for AI collaboration across pair programming, security tooling, trust calibration, code review, tool selection, documentation, and debugging. The toolkit is real. The question that looms over all of it: what does this mean for your role as a technical professional?

Some tasks are being automated. Some are being transformed. The skills that matter are shifting. How do you position yourself for the AI-augmented future?

Next in the series: The Evolving Role of the Technical Professional in an AI World →


Debugging is one of the areas where the Centaur model delivers immediate, practical value. For the complete framework on building effective human-AI partnerships across your technical work, check out The Centaur’s Edge: A Practical Guide to Thriving in the Age of AI.