fix: check HTTP status in batch read_file to prevent silent failures (#36397)

Signed-off-by: gambletan <ethanchang32@gmail.com>
Co-authored-by: gambletan <ethanchang32@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alvin Tang
2026-03-10 22:22:40 +08:00
committed by GitHub
parent a3189a08b0
commit cf88b23749

View File

@@ -320,6 +320,7 @@ class BatchProgressTracker:
async def read_file(path_or_url: str) -> str:
if path_or_url.startswith("http://") or path_or_url.startswith("https://"):
async with aiohttp.ClientSession() as session, session.get(path_or_url) as resp:
resp.raise_for_status()
return await resp.text()
else:
with open(path_or_url, encoding="utf-8") as f: