# wait_for_server_healthy

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/server/wait_for_server_healthy)

Poll a LangGraph server health endpoint until it responds.

## Signature

```python
wait_for_server_healthy(
    url: str,
    *,
    timeout: float = _HEALTH_TIMEOUT,
    process: subprocess.Popen | None = None,
    read_log: Callable[[], str] | None = None,
    local: bool = False,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | `str` | Yes | Server base URL (health endpoint is `{url}/ok`). |
| `timeout` | `float` | No | Max seconds to wait. (default: `_HEALTH_TIMEOUT`) |
| `process` | `subprocess.Popen \| None` | No | Optional subprocess handle; if the process exits early we fail fast instead of waiting for the timeout. (default: `None`) |
| `read_log` | `Callable[[], str] \| None` | No | Optional callable returning log file contents (for error messages on early exit). (default: `None`) |
| `local` | `bool` | No | Use a shorter poll interval for local servers. (default: `False`) |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a9e6e4f7ad7fe161dd9affc3d74bb19784aca70b/libs/cli/deepagents_cli/server.py#L165)