fix: dynamic timeout for tv_key with times > 1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andres Eduardo Garcia Marquez 2026-03-02 09:56:55 -05:00
parent 02070b7f02
commit 66bb08b683
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,8 @@ async def tv_key(key: str, times: int = 1) -> dict[str, Any]:
def _do(): def _do():
_tv.send_key(key, times) _tv.send_key(key, times)
return _ok(f"Sent {key} x{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() @mcp.tool()