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 07:22:40 -07:00
committed by GitHub
co-authored by gambletan Claude Opus 4.6
parent a3189a08b0
commit cf88b23749
+1
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: