From 719c4ee1d189b777e7b0987c6dc5364cf9da6398 Mon Sep 17 00:00:00 2001 From: Bentlybro Date: Mon, 16 Feb 2026 14:46:06 +0000 Subject: [PATCH] fix: add explicit ValueError guard for stat output parsing --- autogpt_platform/backend/backend/util/sandbox_files.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autogpt_platform/backend/backend/util/sandbox_files.py b/autogpt_platform/backend/backend/util/sandbox_files.py index 47fc10bd36..7f767ed3ba 100644 --- a/autogpt_platform/backend/backend/util/sandbox_files.py +++ b/autogpt_platform/backend/backend/util/sandbox_files.py @@ -224,7 +224,15 @@ async def extract_sandbox_files( ) continue - file_size = int(stat_result.stdout.strip()) + try: + file_size = int(stat_result.stdout.strip()) + except ValueError: + logger.debug( + f"Skipping {file_path}: unexpected stat output " + f"{stat_result.stdout.strip()!r}" + ) + continue + if file_size > MAX_BINARY_FILE_SIZE: logger.info( f"Skipping {file_path}: size {file_size} bytes "