The prose says a short page alone should not trigger rendering, but needsRender returns true for every body below MIN_CHARS before checking the shell patterns. A legitimate 200-character status page therefore takes the browser path too.
I would separate “empty extraction” from “short but meaningful content” and test a small real page beside a JavaScript shell. Keeping an explicit escalation reason in Source would make unnecessary renders measurable. That would align the example with the cost-control benefit of exposing Search, Extract and Render as separate tools.
Great catch, Ahmet — thank you! You're right: the code was stricter than the prose. A short page on its own shouldn't trigger Render, but the snippet sent anything under 400 characters straight to the browser. I've updated it so a short body only gets rendered when it also looks like a JavaScript shell ("enable JavaScript", "Loading...", etc.), and a truly empty response still does. So your 200-character status page now stays on the cheap Extract path. Really appreciate you reading that closely.
That change aligns the 200-character status-page case with the intended routing rule. I would add one more distinction for the truly empty response: successful extraction with no usable HTML versus an upstream error or access refusal.
An empty body caused by a timeout, rate limit, or rejected request should carry that failure state rather than automatically becoming a Render attempt. Keeping those reasons separate would make your render-rate metric distinguish JavaScript recovery from extraction failures, instead of treating every escalation as the same kind of work.
Ahmet Özel
AI Engineer. Computer Vision, RAG and LLM agents.
The prose says a short page alone should not trigger rendering, but needsRender returns true for every body below MIN_CHARS before checking the shell patterns. A legitimate 200-character status page therefore takes the browser path too.
I would separate “empty extraction” from “short but meaningful content” and test a small real page beside a JavaScript shell. Keeping an explicit escalation reason in Source would make unnecessary renders measurable. That would align the example with the cost-control benefit of exposing Search, Extract and Render as separate tools.