# summarization_cutoff

> **Function** in `deepagents_code`

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

Return the absolute cutoff index of a `_summarization_event`.

The degrading variant of `validated_summarization_cutoff`, which documents the
rule and why an out-of-bounds cutoff is rejected rather than clamped. Use this
where `0` — "discount nothing" — is the safe reading of an unusable event, and
log the discard where the collapse changes an outcome.

## Signature

```python
summarization_cutoff(
    event: object,
    *,
    message_count: int | None = None,
) -> int
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `event` | `object` | Yes | A `_summarization_event` mapping as persisted in state, or `None`. |
| `message_count` | `int \| None` | No | Full persisted message count when bounds can be checked. (default: `None`) |

## Returns

`int`

The `cutoff_index`, or `0` when the event is missing or malformed.

---

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