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 <[email protected]>
This commit is contained in:
Zaki
2026-03-21 08:12:47 +00:00
committed by Claude
co-authored by Claude Opus 4.6
parent ae4fee1165
commit 2c258213f5
+1 -1
View File
@@ -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 ""