Skip to content

The agent that grows with you

fix(file-tools): count bad_size probe as an existing remote binary

kshitijk4poorb01d11d3f373
diff --git a/tools/file_tools_write_guards.py b/tools/file_tools_write_guards.py
index 5cc1442a091..0b0d0d3aa47 100644
--- a/tools/file_tools_write_guards.py
+++ b/tools/file_tools_write_guards.py
@@ -468,7 +468,8 @@ def _target_regular_file_state(filepath: str, task_id: str = "default") -> str:
_size, status = file_ops._probe_regular_file(file_ops._expand_path(resolved or filepath))
except Exception:
return "unavailable"
- if status == "ok":
+ if status in ("ok", "bad_size"):
+ # bad_size: ``[ -f ]`` succeeded, only ``wc`` was unparseable.
return "exists"
if status in ("missing", "not_regular"):
# not_regular: no REGULAR file at the path (dir/FIFO/dangling link) —