multica/packages
Jiang Bohan 033ff87861 fix(agent): strip toolCalls from aborted/error assistant messages in transcript repair
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>
2026-02-26 17:33:58 +08:00
..
core fix(agent): strip toolCalls from aborted/error assistant messages in transcript repair 2026-02-26 17:33:58 +08:00
hooks fix(chat): stabilize multi-session sync and tool flow 2026-02-17 15:59:25 +08:00
sdk refactor(core-sdk): enforce conversation-only client protocol 2026-02-17 09:41:37 +08:00
store refactor(protocol): add conversationId compatibility across hub/client 2026-02-17 09:39:24 +08:00
types refactor(protocol): add conversationId compatibility across hub/client 2026-02-17 09:39:24 +08:00
ui refactor(agent): remove legacy memory subsystem 2026-02-17 15:33:39 +08:00
utils feat(utils): add SMC_DATA_DIR env var to override root data directory 2026-02-15 00:39:13 +08:00