Interrupting (Esc) while assistant is in thinking mode (reasoning only, no text output yet) breaks the session.
Next request fails with:
messages.X: all messages must have non-empty content except for the optional final assistant message
Related to #3101 but different root cause.
Repro:
- Use thinking model (claude-opus with
high variant)
- Interrupt while "Thinking:" is displayed, before any text
- Send another message → 400 error
Cause:
message-v2.ts:toModelMessage() line 483:
msg.parts.some((part) => part.type !== "step-start" && part.type !== "reasoning")
Aborted messages should be skipped if they only have step-start/reasoning. But the patch part (created on abort) passes this check, so the message gets included with only reasoning content. Anthropic rejects non-final assistant messages with only reasoning.
Fix:
Add patch to exclusion, or check for output-producing parts (text, tool) explicitly.