From 25d00b1ea4648b14c28fa00027de286da27c604d Mon Sep 17 00:00:00 2001 From: hinotoi-agent Date: Wed, 20 May 2026 17:01:57 +0800 Subject: [PATCH] fix(web): support redirect handling in fake responses --- nanobot/agent/tools/web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nanobot/agent/tools/web.py b/nanobot/agent/tools/web.py index 112167b48..71b1011d1 100644 --- a/nanobot/agent/tools/web.py +++ b/nanobot/agent/tools/web.py @@ -95,7 +95,8 @@ async def _get_with_safe_redirects( return None, f"Redirect blocked: {error_msg}" response = await client.get(current_url, headers=headers, follow_redirects=False) - if not response.is_redirect: + is_redirect = 300 <= response.status_code < 400 + if not is_redirect: return response, None location = response.headers.get("location")