The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(lsp): abort diagnostics waits after transport death
fangliquanflq142017639329
diff --git a/agent/lsp/client.py b/agent/lsp/client.pyindex 12f263f1e7f..36c27210276 100644--- a/agent/lsp/client.py+++ b/agent/lsp/client.py@@ -919,6 +919,10 @@ class LSPClient:abs_path = os.path.abspath(path)while True:+ if not self._connection_is_open():+ raise LSPProtocolError(+ "server connection closed while waiting for diagnostics"+ )remaining = deadline - asyncio.get_event_loop().time()if remaining <= 0:return Falsediff --git a/tests/agent/lsp/test_client_e2e.py b/tests/agent/lsp/test_client_e2e.pyindex 9a9cde8f076..6864008b318 100644--- a/tests/agent/lsp/test_client_e2e.py+++ b/tests/agent/lsp/test_client_e2e.py@@ -107,11 +107,16 @@ async def test_reader_failure_retires_client_and_rejects_later_work(assert proc is not Noneassert reader_task is not Nonetry:- await client.open_file(str(f), language_id="python")+ version = await client.open_file(str(f), language_id="python")await asyncio.wait_for(asyncio.shield(reader_task), timeout=3.0)assert not client.is_runningawait asyncio.wait_for(proc.wait(), timeout=3.0)+ with pytest.raises(LSPProtocolError):+ await asyncio.wait_for(+ client.wait_for_diagnostics(str(f), version, timeout=3.0),+ timeout=0.5,+ )with pytest.raises(LSPProtocolError):await asyncio.wait_for(client.open_file(str(f), language_id="python"),