From 425031cef8116bcebb2d242330478d5e30914fd4 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Fri, 10 Jul 2026 14:56:17 -0700 Subject: [PATCH 1/2] Clarify determinism of wait_condition with comment --- temporalio/workflow/_context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/temporalio/workflow/_context.py b/temporalio/workflow/_context.py index 23c943cd0..33c1857ae 100644 --- a/temporalio/workflow/_context.py +++ b/temporalio/workflow/_context.py @@ -928,6 +928,10 @@ async def wait_condition( This function returns when the callback returns true (invoked each loop iteration) or the timeout has been reached. + Importantly, using a `0` or `None` value for `timeout` means that no Temporal timer is created. + This means changing from either of those values to a positive value (or the inverse) constitutes + a nondeterministic change to workflow code. + Args: fn: Non-async callback that accepts no parameters and returns a boolean. timeout: Optional number of seconds to wait until throwing From f66401c4a5b375fbedced8fbc5c319db94064bef Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 15 Jul 2026 09:46:23 -0700 Subject: [PATCH 2/2] Make 0 make more sense --- temporalio/workflow/_context.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/temporalio/workflow/_context.py b/temporalio/workflow/_context.py index 33c1857ae..d2ec0d633 100644 --- a/temporalio/workflow/_context.py +++ b/temporalio/workflow/_context.py @@ -928,9 +928,10 @@ async def wait_condition( This function returns when the callback returns true (invoked each loop iteration) or the timeout has been reached. - Importantly, using a `0` or `None` value for `timeout` means that no Temporal timer is created. - This means changing from either of those values to a positive value (or the inverse) constitutes - a nondeterministic change to workflow code. + Importantly, using `None` value for ``timeout`` means that no Temporal timer is created. This + means changing from `None` to a positive value (or the inverse) constitutes a nondeterministic + change to workflow code. Using ``0`` will cause this function to immediately throw a timeout and + should not be used. Args: fn: Non-async callback that accepts no parameters and returns a boolean.