# superseded_goal_state_placeholder

> **Function** in `deepagents_code`

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

Build a bounded same-index stand-in for an oversized prior notice.

An oversized notice must stop being model-visible, but it cannot be removed
from a model request. The summarizer picks its cutoff from `request.messages`
and persists that cutoff as an absolute index into `state["messages"]`, which
this middleware never filters. Any removal makes the two lists disagree by the
number of dropped entries, so the persisted cutoff slices the checkpointed
list too early: live turns vanish, and a `ToolMessage` can outlive the
`AIMessage` that called it (which the provider rejects).

Replacing in place keeps the length, every later index, and the human/AI/tool
shape identical to the checkpointed list, so the cutoff the summarizer chooses
is valid in both. The stand-in keeps the original `id` so an `add_messages`
reducer would overwrite rather than append if one ever saw it.

## Signature

```python
superseded_goal_state_placeholder(
    message: object,
) -> HumanMessage
```

## Returns

`HumanMessage`

Internal message that preserves the replaced notice's identifier.

---

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