( messages: Message[], interruptedUserMessage: NormalizedUserMessage, )
| 4907 | * @internal Exported for testing |
| 4908 | */ |
| 4909 | export function removeInterruptedMessage( |
| 4910 | messages: Message[], |
| 4911 | interruptedUserMessage: NormalizedUserMessage, |
| 4912 | ): void { |
| 4913 | const idx = messages.findIndex(m => m.uuid === interruptedUserMessage.uuid) |
| 4914 | if (idx !== -1) { |
| 4915 | // Remove the user message and the sentinel that immediately follows it. |
| 4916 | // splice safely handles the case where idx is the last element. |
| 4917 | messages.splice(idx, 2) |
| 4918 | } |
| 4919 | } |
| 4920 | |
| 4921 | type LoadInitialMessagesResult = { |
| 4922 | messages: Message[] |
no outgoing calls
no test coverage detected