fix(agent): remove redundant whitespace and truncation logic from browser fetch
This commit is contained in:
@@ -467,14 +467,6 @@ def _fetch_page_with_browser(url: str, max_chars: int = _BROWSER_FETCH_MAX_CHARS
|
||||
except Exception as e:
|
||||
print(f"[BROWSER] FAILED url={url} err={type(e).__name__}: {e}")
|
||||
return ""
|
||||
# Clean up whitespace
|
||||
lines = [line.strip() for line in text.splitlines() if line.strip()]
|
||||
cleaned = "\n".join(lines)
|
||||
# Remove excessive repeated sections that come from navigation menus
|
||||
if len(cleaned) > max_chars:
|
||||
cleaned = cleaned[:max_chars] + "..."
|
||||
print(f"[BROWSER] ok url={url} chars={len(cleaned)}")
|
||||
return cleaned
|
||||
except ImportError:
|
||||
# Playwright not installed, return empty to let caller use fallback
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user