weiqingy commented on code in PR #926:
URL: https://github.com/apache/flink-agents/pull/926#discussion_r3671213309


##########
python/flink_agents/runtime/flink_runner_context.py:
##########
@@ -241,6 +253,58 @@ def __await__(self) -> Any:
         return result
 
 
+class _DurableBatchAsyncExecutionResult(AsyncExecutionResult):
+    def __init__(self, ctx: "FlinkRunnerContext", calls: list[DurableCall]) -> 
None:
+        self._ctx = ctx
+        self._calls = calls
+
+    def __await__(self) -> Any:
+        plan = self._ctx._prepare_batch_execution(self._calls)
+        futures = [
+            self._ctx.tool_call_executor.submit(supplier) for _, supplier in 
plan.suppliers
+        ]
+        timeout_ms = 
self._ctx.config.get(AgentExecutionOptions.TOOL_CALL_BATCH_TIMEOUT)
+        deadline = time.monotonic() + timeout_ms / 1000 if timeout_ms >= 0 
else None

Review Comment:
   `timeout_ms >= 0` makes a configured `0` mean "deadline is now" rather than 
"no timeout" — the first check in the loop fires and every batch fails with a 
`TimeoutError` before any tool can finish.
   
   Java goes the other way, returning no deadline when `timeout.isZero() || 
timeout.isNegative()` (`ContinuationActionExecutor.java:255`), and the config 
table added in this PR documents it as "Non-positive disables it" 
(`configuration.md:137`). The `-1` default keeps this out of the way today, but 
`0` is the natural thing to write for "no timeout". Should this be `> 0`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to