fix: PTC timeout handling and nesting depth panic safety

- Python SDK: remove 60s minimum timeout enforcement, respect
  requested timeout with 5s network buffer
- Rust executor: cap timeout at MAX_TIMEOUT_SECS instead of
  falling back to default when exceeded
- WASM wrapper: use RAII guard for nesting depth to prevent
  leak on panic

Addresses Gemini review feedback on PR #408.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Zaki
2026-03-21 08:12:37 +00:00
committed by Claude
co-authored by Claude Opus 4.6
parent ac8083bd85
commit cd23380a66
6 changed files with 76 additions and 63 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ def call_tool(name, params=None, timeout_secs=None):
)
try:
with urllib.request.urlopen(req, timeout=max(timeout_secs or 60, 60) + 5) as resp:
with urllib.request.urlopen(req, timeout=(timeout_secs or 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 ""