Repository navigation
#561 fix: fetch-and-render answers 422 target_unreachable for an unreachable target, not 500 - #562
Merged
Merged
Conversation
…y, for fetch-and-render's tests too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…port error, not 500 fetch_2xx's transport leg becomes fetch_target, shared with fetch_and_render; a non-2xx stays a 200 with status_code, render=True stays 501. v4.49.2; SDK unchanged (5.19.0), docstrings only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s context budget Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 28, 2026
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.
Closes #561 (epic #503, Tier 1).
Change
POST /api/v1/tools/fetch-and-renderanswered 500kind="server"when the fetch failed. It now answers 422kind="domain", withtarget_unreachableat/url, aspreview-extractionandpropose-selectorsalready do (#473). That covers DNS, a refused connection, a timeout, and a TLS error that persists after retries.fetch_target(src/core/tools/target_fetch.py) is the transport leg. It catcheshttpx.HTTPErrorand raisesTargetUnreachableError(str(e) or type(e).__name__).fetch_2xxis nowfetch_targetplus the 2xx gate.fetch_and_rendercallsfetch_target._raise_fetch_refusal.status_code, and the route gets notarget_http_error.render=Trueis still a 501, before any fetch.archiver-clientstays 5.19.0: the regenerated client and the hand-written wrappers move docstrings only, per Preview extraction ignores the HTTP status: a 403 bot challenge reads as "selector matched nothing" #473's precedent. There's nosdk_tagpush.test_tools_preview_extraction.pytotests/api/conftest.py. New tests:ReadTimeout,ReadError, persistent and one-off rawssl.SSLError, non-2xx → 200,render=True→ 501 before a fetch;fetch_targetunit tests;tests/core/tools/test_fetch_and_render.py._raise_fetch_refusal's docstring,target_fetch's module docstring,docs/API.md's row and the CHANGELOG.preview-extraction's description no longer says it composesfetch_and_render.Verification
scripts/pre-ship.sh: 6195 passed, 6 skipped, vitest 142.client-driftOK.https://nonexistent.invalid/→ 422target_unreachable("[Errno -2] Name or service not known"); a URL returning 404 → 200 withstatus_code: 404;render: true→ 501.490d9736,470dc726); 3 and 4 are stet.Known limits and post-merge host steps: #561 (comment)
🤖 Generated with Claude Code