superseded_goal_state_placeholder(
message: object,
) -> HumanMessageBuild 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.