From 66bb08b683c569cc6ce58fd4a1394769fcc5dcab Mon Sep 17 00:00:00 2001 From: Andres Eduardo Garcia Marquez Date: Mon, 2 Mar 2026 09:56:55 -0500 Subject: [PATCH] fix: dynamic timeout for tv_key with times > 1 Co-Authored-By: Claude Opus 4.6 --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 64e87bf..6ced0c3 100644 --- a/main.py +++ b/main.py @@ -107,7 +107,8 @@ async def tv_key(key: str, times: int = 1) -> dict[str, Any]: def _do(): _tv.send_key(key, times) return _ok(f"Sent {key} x{times}") - return await _safe(_do) + t = max(TOOL_TIMEOUT, times * 0.3 + 5) + return await _safe(_do, timeout=t) @mcp.tool()