You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
load_web_page returns an empty string for Chinese and Japanese pages #7956
load_web_page drops every line of a page written in Chinese or Japanese, so the tool returns an empty string and the agent gets no content.
It keeps only lines with more than three words, and counts words with len(line.split()) (src/google/adk/tools/load_web_page.py). Chinese and Japanese text has no spaces between words, so a whole line counts as one word and is filtered out. Thai, Lao, Khmer and Myanmar are written without spaces too.
Steps to Reproduce:
Install google-adk 2.13.0 (also reproduced on main @ 3565ad3) with beautifulsoup4 and lxml.
Run the script under "Minimal Reproduction Code". It replaces _fetch_content with the same small page in three languages, so no network access is needed.
Expected Behavior:
The paragraphs of the Chinese and Japanese pages are returned, as they are for the English page. Only the one-word navigation item is dropped.
Observed Behavior:
--- English: 136 characters returned
2024 Model Y price
The 2024 Model Y starts at 249,900 yuan after subsidies.
Deliveries for orders placed this month begin in four weeks.
--- Chinese: 0 characters returned
(empty)
--- Japanese: 0 characters returned
(empty)
Environment Details:
ADK Library Version (pip show google-adk): 2.13.0 (also on main @ 3565ad3)
Desktop OS: macOS 26.6.2
Python Version (python -V): 3.12.7
Model Information:
Are you using LiteLLM: N/A (no model call needed to reproduce)
Which model is being used: N/A
Minimal Reproduction Code:
"""Repro: load_web_page drops every line of a Chinese or Japanese page."""fromunittestimportmockfromgoogle.adk.toolsimportload_web_pageasload_web_page_modulePAGES= {
"English": """<html><body><nav>Home</nav><h1>2024 Model Y price</h1><p>The 2024 Model Y starts at 249,900 yuan after subsidies.</p><p>Deliveries for orders placed this month begin in four weeks.</p></body></html>""",
"Chinese": """<html><body><nav>首页</nav><h1>2024款Model Y价格</h1><p>2024款Model Y补贴后起售价为24.99万元。</p><p>本月下单的车辆预计四周后开始交付。</p></body></html>""",
"Japanese": """<html><body><nav>ホーム</nav><h1>2024年モデルYの価格</h1><p>2024年モデルYの補助金適用後の価格は249万円からです。</p><p>今月の注文分は4週間後に納車が始まります。</p></body></html>""",
}
forlanguage, htmlinPAGES.items():
withmock.patch.object(
load_web_page_module, "_fetch_content", return_value=html.encode()
):
text=load_web_page_module.load_web_page("https://example.com/")
print(f"--- {language}: {len(text)} characters returned")
print(textor"(empty)")
Confirmed: the len(line.split()) > 3 filter in load_web_page.py counts a whole line of Chinese, Japanese, Thai, etc. as a single word, so those lines are dropped and the page returns empty.
Activity
sanketpatil06 commentedon Nov 4, 2026
Thanks for the report and repro, @Fruiterer333.
Confirmed: the
len(line.split()) > 3filter inload_web_page.pycounts a whole line of Chinese, Japanese, Thai, etc. as a single word, so those lines are dropped and the page returns empty.I've verified #7957 locally and it resolves this:
tests/unittests/tools/test_load_web_page.py: 38 passed首页/ホームare still filtered, and English output is unchanged.Further review will continue on #7957.
fix: keep Chinese and Japanese lines in load_web_page