# INVALID_CHAT_HISTORY

## How you get here

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.

## Fix

Option A: supply the missing ToolMessages and invoke; they append to history and the graph runs from the START node:

```python
graph.invoke({"messages": [ToolMessage(content="...", tool_call_id="...")]})
```

Option B: repair the state and resume from the interrupt:

1. `graph.get_state(config)` and look at the recent messages.
2. Remove the unanswered tool calls from the AIMessages, or add ToolMessages with matching tool_call_ids.
3. `graph.update_state(config, {"messages": [...]})` with the fixed list.
4. Resume with `graph.invoke(None, config)`.

## Rule

On resume after an interrupt, the input must answer the pending tool calls. New user input goes in only after the tool results are in place.