CLAUDE LABJP
SONNET — Claude Sonnet 5 is now the default model in Claude Code, with a native 1M-token context window and introductory pricing through August 31CHROME — Claude in Chrome reaches general availability, letting you hand browser work directly to ClaudeCOWORK — Cowork expands to mobile and web so sessions and files follow you across devices, starting in beta for Max usersDATAVIZ — Claude Code adds a /dataviz skill offering guidance for designing charts and dashboardsAGENTS — Agent workflows gain background notifications, draft PR handoff, and improved failoverENTERPRISE — Claude Enterprise adds richer admin analytics, model-level entitlements, and spend alertsSONNET — Claude Sonnet 5 is now the default model in Claude Code, with a native 1M-token context window and introductory pricing through August 31CHROME — Claude in Chrome reaches general availability, letting you hand browser work directly to ClaudeCOWORK — Cowork expands to mobile and web so sessions and files follow you across devices, starting in beta for Max usersDATAVIZ — Claude Code adds a /dataviz skill offering guidance for designing charts and dashboardsAGENTS — Agent workflows gain background notifications, draft PR handoff, and improved failoverENTERPRISE — Claude Enterprise adds richer admin analytics, model-level entitlements, and spend alerts
Articles/Claude.ai
Claude.ai/2026-07-11Advanced

When a Connector Starts Slowing Down at Night: A Health-Aware Circuit Breaker for Solo Automation

Seeing connector errors and latency is only half the job — the other half is deciding when to route around them. This is my implementation of a circuit breaker that opens on error rate and p95, with runnable Python and notes on wiring it into nightly jobs.

MCP41connectors3circuit-breaker4automation91indie-dev14

Premium Article

The week after I added instrumentation, the same connector started slowing down again.

Last time it had failed silently for two nights before I noticed. This time it wasn't erroring at all — the latency just crept upward. The p95 climbed from its usual 900ms to somewhere near 12,000ms. The nightly job wasn't crashing, but every single item was clinging to the edge of a timeout. The logs made the trouble obvious. But that night, I was asleep.

Seeing a number and acting on a number turned out to be two different things. Observability gave me a dashboard, yet without someone at the wheel when the needle swings into the red, the run just keeps stacking up the same failure until dawn. This time I wanted the "turning the wheel" part to run on its own, with no one watching.

The instrumentation itself I wrote up earlier, in bringing nightly connector observability into a solo setup. This piece is the sequel: turning those collected signals into a decision about whether to route around the connector.

Plain retries backfire on a slow night

The first thing I reached for was a naive retry. On failure, wait a moment and call again. That works when the failure mode is a hard error. But when a connector fails the way this one did — slow instead of down — retrying made things worse.

If a call clings on for 12 seconds and then fails, and you retry three times, you've burned 48 seconds on that one item. When you're running dozens of items in sequence overnight, everything downstream gets pushed out, and the whole night's batch quietly comes up empty. The harder you push against a slow connector, the more you drag perfectly healthy downstream work down with it.

What I needed wasn't a "keep trying" decision but a "stay away for now" decision. While the connector is unwell, hold back the calls, divert the work to a fallback, and ease back in to check once there's a sign of recovery. That is exactly the old idea of a circuit breaker. I decided to slip one of these breakers into my solo nightly jobs.

Three signals for measuring health

Whether to open the breaker is decided from three numbers taken over a recent observation window (I use 15 minutes).

SignalMeaningMy starting threshold
Error rateFailures / total calls within the windowOpen above 0.5
p95 latencyThe practical ceiling, dropping the slowest 5%Open above 8,000ms
Minimum samplesHold off deciding below this count8 calls

Watching p95 rather than the mean was the crucial part. When most responses are fast, the mean dilutes the slow ones and hides the state where only a fraction are near timeout. On the night above, the mean sat comfortably around 3 seconds while the p95 had reached 12. The p95 is the more honest way to capture a heavy tail.

The minimum-sample floor exists so I don't jump to conclusions on the first few calls. Nightly jobs tend to be shaky right after they start, and if the first two happen to be slow, tripping the breaker there would shut out a perfectly healthy connector.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
If a slowing connector has been quietly wasting your nightly runs until morning, you'll be able to decide automatically — from error rate and p95 — whether to route around it right now
You'll get the Closed / Open / Half-Open three-state machine and its rolling window as Python you can copy and run as-is
You'll learn how to carry connector health across process boundaries in scheduled jobs, and to confirm recovery without trusting a single lucky success
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude.ai2026-07-07
A connector failed for two nights and I never noticed — instrumenting my solo setup after observability went to public beta
The week connector observability hit public beta, I realized my one-person operation had no view into errors or latency. Here is how I wrapped my MCP connector calls in a thin meter and started reviewing it weekly.
Claude.ai2026-04-11
Claude MCP × Agent Workflows: Designing and Building Real-World Automation Systems
A practical guide to designing and building automation workflows by combining Model Context Protocol (MCP) with Claude agents — from architecture design to implementation and production deployment.
Claude.ai2026-07-04
Claude in Chrome Went GA and I Stopped Babysitting the Tab — Where Background Notifications and Handoff Actually Help
Claude in Chrome's general availability adds background notifications, draft handoff, and better failover. As someone who hands browser work to it daily in solo development, here's what to notify on, what to leave running, and the settings I actually changed.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →