Conversation
fetch_url_to_workspace never checked the HTTP status, so a 403/404
block page was saved to the workspace as if it were real content and
the tool returned "Fetched URL successfully". Downstream, an analyzer
agent reads the junk, reports the file empty/invalid, and the searcher
retries with new queries and URLs until it exhausts its web_search
quota and loop-detection aborts it. A first-try-correct answer thus
degrades into a delegation loop.
Two changes:
- Call resp.raise_for_status() and return a clear, actionable error
("HTTP N, page NOT saved, do not retry, use a different source")
instead of writing the error page as content.
- Use a descriptive User-Agent derived from APP_NAME. The spoofed 2021
Chrome UA was itself triggering bot-blocking; sites like Wikipedia
return 200 with a descriptive UA where the old one got 403.
Verified in a generated agent: Wikipedia now saves 160KB+ of real
markdown (previously an empty 403 page); a genuinely blocked source
(Britannica) returns the error message and writes no file.
Found while debugging an agent generated by this skill
(kyuz0/deep-research-agent); this upstreams the same fix.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetch_url_to_workspacein thebasic-tui-agentscaffold never checks the HTTP status, so a 403/404 block page is saved to the workspace as if it were real content and the tool reports"Fetched URL successfully". Downstream, an analyzer agent reads the junk, reports the file empty/invalid, and the searcher retries with new queries and URLs until it exhausts itsweb_searchquota and loop-detection aborts the run. A first-try-correct answer degrades into a delegation loop.Changes
resp.raise_for_status()and return a clear, actionable error ("HTTP N, page NOT saved, do not retry, use a different source") instead of writing the error page as content. The generic exception path gets the same actionable phrasing (the old raw-traceback return gave the model nothing to act on).APP_NAME(following the existingimport config as app_configpattern inweb_search). The spoofed 2021 Chrome UA was itself triggering bot-blocking: sites like Wikipedia return 200 with a descriptive UA where the old one got 403. Deriving it fromAPP_NAMEmeans generated agents automatically identify themselves correctly.Verification
Verified in a generated agent: Wikipedia now saves 160KB+ of real markdown (previously an empty 403 block page was saved); a genuinely blocked source (Britannica) returns the error message and writes no file.
Context
Found while debugging an agent generated by this skill — this is the scaffold-level version of kyuz0/deep-research-agent#3.
🤖 Generated with Claude Code