fix(hanzo-mcp): v0.10.4 - fix search hanging and null process_manager

- Add 30s timeout to each search engine (grep, ast, lsp, git)
- Fix NoneType error when process_manager unavailable in auto_timeout
- Prevents LSP engine from hanging indefinitely on large codebases
This commit is contained in:
2025-12-25 19:58:46 -08:00
parent 3857226b3c
commit 8750f1ce8b
3 changed files with 12 additions and 4 deletions
@@ -172,7 +172,12 @@ def with_auto_timeout(tool_name: str, timeout_manager: Optional[MCPToolTimeoutMa
return result
except asyncio.TimeoutError:
# Tool timed out - background it
# Tool timed out - background it if process manager is available
if timeout_manager.process_manager is None:
# No process manager - just report timeout
timeout_formatted = format_timeout(tool_timeout)
return f"Operation timed out after {timeout_formatted}. Backgrounding unavailable."
process_id = f"{tool_name}_{uuid.uuid4().hex[:8]}"
log_file = await timeout_manager.process_manager.create_log_file(process_id)
@@ -131,10 +131,13 @@ class SearchTool(BaseTool):
stats = {"query": pattern, "path": path, "engines": [], "time_ms": {}}
all_results = []
async def timed(name: str, coro):
async def timed(name: str, coro, timeout: float = 30.0):
"""Run coroutine with timeout and timing."""
start = time.time()
try:
results = await coro
results = await asyncio.wait_for(coro, timeout=timeout)
except asyncio.TimeoutError:
results = [] # Engine timed out
except Exception:
results = []
elapsed = int((time.time() - start) * 1000)
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "hanzo-mcp"
version = "0.10.3"
version = "0.10.4"
description = "The Zen of Hanzo MCP: One server to rule them all. The ultimate MCP that orchestrates all others."
readme = "README.md"
requires-python = ">=3.12"