From 2c258213f5ae28c00d1b0e523918ab39e2d5bfc7 Mon Sep 17 00:00:00 2001 From: Zaki Date: Sun, 1 Mar 2026 10:04:11 -0800 Subject: [PATCH] fix: address review feedback on PTC - Fix Python SDK client timeout to use actual timeout_secs + 5s buffer instead of enforcing 60s minimum - Cap tool execution timeout at MAX_TIMEOUT_SECS instead of falling back to default when exceeded - Use RAII guard for tool_nesting_depth to ensure decrement on panic Co-Authored-By: Claude Opus 4.6 --- sdk/python/ironclaw_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/ironclaw_tools.py b/sdk/python/ironclaw_tools.py index 18a66418..cb2355ee 100644 --- a/sdk/python/ironclaw_tools.py +++ b/sdk/python/ironclaw_tools.py @@ -84,7 +84,7 @@ def call_tool(name, params=None, timeout_secs=None): ) try: - with urllib.request.urlopen(req, timeout=(timeout_secs or 60) + 5) as resp: + with urllib.request.urlopen(req, timeout=(timeout_secs if timeout_secs is not None else 60) + 5) as resp: result = json.loads(resp.read().decode("utf-8")) except urllib.error.HTTPError as e: body_text = e.read().decode("utf-8", errors="replace") if e.fp else ""