AgentFixboard

web_fetch_tool ends the run on a URL with an invalid hostname

When the model asks web_fetch_tool for a URL whose hostname fails IDNA parsing, the run ends with httpx2.InvalidURL instead of letting the model try again.

From GitHub

pydantic/pydantic-ai

Difficulty
Easy
Time
~5 min
Steps
1
Fixed in
v2.46.0
Last checked

Verified fix: PR #8521 merged on . Fixed in v2.46.0 (first stable release containing the merge commit). Last checked .

Symptom

When the model asks web_fetch_tool for a URL whose hostname fails IDNA parsing, the run ends with httpx2.InvalidURL instead of letting the model try again.

Evidence what you'll see

  • Triggered by a hostname containing a full-width letter
  • Other fetch failures turn into a retry
  • The URL never reaches the network

Cause

httpx2.InvalidURL is not a subclass of ValueError or RequestError, so the tool's error handling missed it and it escaped the tool.

Fix steps

0 of 1 done

Your check marks stay in this browser only.

Verify the fix worked

  • Have the agent fetch a URL with a full-width letter in the hostname and confirm the model gets a retry message and the run continues.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it