DEV Community

Cover image for Attempt counts taught me that the third try is usually the honest one
InApp
InApp

Posted on Originally published at imapp.blogspot.com

Attempt counts taught me that the third try is usually the honest one

I instrumented every call in my web-to-agent pipeline for a month and the data surprised me: the first attempt succeeds about 40% of the time, the second bumps it to 65%, but the third attempt is where success jumps to 90%. Not because the third try is luckier — because by then the system has learned what the page actually is.

Early on I treated failed fetches as noise and just retried blindly with the same parameters. The turning point came when I logged why each attempt failed instead of just that it failed. Attempt one usually dies on bot-walls or JavaScript-heavy shells, attempt two on inconsistent DOM structures, and attempt three — with a fallback selector or a rendered snapshot — is the one that actually extracts the article body. The attempt count became a diagnostic signal, not a retry counter.

What I shipped from this is a URL-to-Markdown endpoint that tries multiple extraction strategies in sequence and returns the cleanest result, logging which attempt won: https://x402.freeq.one/tools/markdown.html

The lesson for anyone shipping agent-facing tools: don't hide your attempts, count them. A tool that fails twice and succeeds on the third isn't flaky — it's just being honest about how messy the web is. Build for the third attempt, and the first two stop feeling like failures.

Top comments (0)