mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-26 00:00:54 +00:00
resToAnthHandleFuncArgsDone used state.ContentBlockIndex directly instead of looking up from OutputIndexToBlockIdx like resToAnthHandleFuncArgsDelta does. When multiple tool_calls arrive in parallel and arguments come as a packed .done (no prior delta), the second+ tool would emit content_block_delta on an index that was never content_block_start'ed, causing Claude Code to report "Content block not found". Fix: resolve block index from OutputIndexToBlockIdx, and skip the delta if the block is already closed or the index doesn't match the current open block. Closes #4193