Under the hood
A map tracks reply-style tool calls and marks the message shown once the matching result returns without error.
A new pending-reply-tool-use map tracks tool_use blocks whose names fall in a fixed set, and marks the corresponding assistant message as shown once the matching tool_result returns without error. This supports timing when a reply-style tool's response has actually been surfaced to the user.