397
});
398
}
400
>
status: ToolCallStatus.Completed,
401
>
toolCallId: previousState.toolCallId,
402
>
toolName: previousState.toolName,
403
>
displayName: previousState.displayName,
404
>
invocationMessage: previousState.invocationMessage ?? previousState.displayName,
405
>
toolInput: previousState.status === ToolCallStatus.Streaming ? undefined : previousState.toolInput,
406
>
confirmed: ToolCallConfirmationReason.NotNeeded,
407
>
success: !isError,
408
>
pastTenseMessage: getClaudePastTenseMessage(previousState.toolName, previousState.displayName, entry.parsedInput, !isError, resultText),
409
>
content: content.length > 0 ? content : undefined,
410
>
...(previousState._meta ? { _meta: previousState._meta } : {}),
411
>
};
412
>
part.toolCall = completed;
413
>
// Drain pending tracker on the announcing turn — but only if that
414
>
// turn is still in progress. Committed turns have their state
415
>
// locked at close time per Fixture 6b ("orphan in turn N does
416
>
// NOT cancel turn N+1"); a late-arriving tool_result for a
417
>
// committed turn doesn't re-promote it.
418
>
if (this._active?.id === announcingTurnId) {
419
this._active.pendingToolUseIds.delete(block.tool_use_id);
420
}
422
>
}
423
424
private _findToolCallPart(turnId: string, toolUseId: string): ToolCallResponsePart | undefined {
426
return this._active.toolCallParts.get(toolUseId);
427
}