# managed_health

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/configuration/service/managed_health)

Return both halves of exit 78 for one managed snapshot.

Reading health and violations as two calls is a live bug, not a style
choice. `get_managed_snapshot` declines to cache a candidate it cannot
enforce, so a refreshed status describes the file on disk while a second,
non-refreshed violation read still sees the last enforceable snapshot and
reports none. Every diagnostic surface then shows `ok` for the exact file
that just refused to launch. One snapshot, both answers.

## Signature

```python
managed_health(
    *,
    refresh: bool = False,
) -> ManagedHealth
```

## Returns

`ManagedHealth`

Health, violations, and ignored rejections that cannot disagree.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/configuration/service.py#L983)