**TL;DR:** The prebuilt agent's model node received a message list where an AIMessage has tool_calls with no matching ToolMessages. This happens when you resume after an interrupt (manual or from a tool error) with the wrong input. Remove the unanswered tool calls from the AIMessages, or add ToolMessages with matching tool_call_ids. Rule On resume after an interrupt, the input must answer the pending tool calls.

## The fix

1. You invoke the graph with a hand-built message list containing an AIMessage with tool_calls and no ToolMessages.

2. The graph was interrupted before the tools node ran (you set `interrupt_before=["tools"]`, or a tool raised an unhandled error), and you resumed with a plain HumanMessage or new input instead of the pending tool results.

3. `graph.get_state(config)` and look at the recent messages.

4. Remove the unanswered tool calls from the AIMessages, or add ToolMessages with matching tool_call_ids.

5. `graph.update_state(config, {"messages": [...]})` with the fixed list.

6. Resume with `graph.invoke(None, config)`.

## When to use this

- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: INVALID_CHAT_HISTORY.
- You want the fastest verified fix before digging through logs.

## When not to use this

- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.

## Compatibility

- Not pinned to a specific version; follows current INVALID_CHAT_HISTORY behavior.