Skip to content

The agent that grows with you

fix: clamp invalid effective_timeout to the 120s wait default instead of unbounded (review follow-up for #94305)

Teknium53e3c14f1d93
diff --git a/tools/environments/base.py b/tools/environments/base.py
index 561fca5f8e4..c4acd344028 100644
--- a/tools/environments/base.py
+++ b/tools/environments/base.py
@@ -1556,7 +1556,10 @@ class BaseEnvironment(ABC):
try:
bound_s = float(effective_timeout) + _EXECUTE_WAIT_BOUND_GRACE_S
except (TypeError, ValueError):
- bound_s = None
+ # Defensive: a non-numeric timeout must not silently disable the
+ # backstop (that would recreate the unbounded wait this bound
+ # exists to prevent). Fall back to the module's 120s wait default.
+ bound_s = 120.0 + _EXECUTE_WAIT_BOUND_GRACE_S
try:
bounded = run_bounded_sync(