# latest_goal_state_notice

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/goal_state_notice/latest_goal_state_notice)

Return the newest valid notice and its raw-history index.

## Signature

```python
latest_goal_state_notice(
    messages: Sequence[object],
) -> tuple[int, GoalStateNoticeInfo] | None
```

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/goal_state_notice.py#L823)