When a streaming request is aborted mid-toolCall, the session persists an assistant message with stopReason "aborted" containing partial toolCall blocks. Our sanitizeToolUseResultPairing then inserts synthetic toolResults for these toolCalls. However, pi-ai's transformMessages drops the entire aborted assistant message downstream, leaving orphaned toolResults that reference non-existent tool_use_ids — causing persistent 400 errors that block all subsequent conversations in the session. Fix: in repairToolCallInputs, strip toolCall blocks from assistant messages with stopReason "aborted" or "error" before the result-pairing sanitizer runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| core | ||
| hooks | ||
| sdk | ||
| store | ||
| types | ||
| ui | ||
| utils | ||