diff --git a/openspec/changes/lsp-integration-tests/tasks.md b/openspec/changes/lsp-integration-tests/tasks.md index cf8f609c7..4a8edd1c4 100644 Binary files a/openspec/changes/lsp-integration-tests/tasks.md and b/openspec/changes/lsp-integration-tests/tasks.md differ diff --git a/tests/integration/test_lsp_integration.py b/tests/integration/test_lsp_integration.py index 681d1724d..17055acf7 100644 --- a/tests/integration/test_lsp_integration.py +++ b/tests/integration/test_lsp_integration.py @@ -83,4 +83,20 @@ async def test_lsp_client_send_notification(): await client.send_notification("custom/notify", {"data": "test"}) finally: - await client.shutdown() \ No newline at end of file + await client.shutdown() + + +@pytest.mark.anyio +async def test_lsp_client_send_request_not_connected(): + """Test LSP client raises RuntimeError when sending request while not connected.""" + client = AstrbotLspClient() + with pytest.raises(RuntimeError, match="LSP client not connected"): + await client.send_request("test", {}) + + +@pytest.mark.anyio +async def test_lsp_client_send_notification_not_connected(): + """Test LSP client raises RuntimeError when sending notification while not connected.""" + client = AstrbotLspClient() + with pytest.raises(RuntimeError, match="LSP client not connected"): + await client.send_notification("test", {}) \ No newline at end of file