( messages: Message[], interruptedUserMessage: NormalizedUserMessage, )
| 4873 | * @internal Exported for testing |
| 4874 | */ |
| 4875 | export function removeInterruptedMessage( |
| 4876 | messages: Message[], |
| 4877 | interruptedUserMessage: NormalizedUserMessage, |
| 4878 | ): void { |
| 4879 | const idx = messages.findIndex(m => m.uuid === interruptedUserMessage.uuid) |
| 4880 | if (idx !== -1) { |
| 4881 | // Remove the user message and the sentinel that immediately follows it. |
| 4882 | // splice safely handles the case where idx is the last element. |
| 4883 | messages.splice(idx, 2) |
| 4884 | } |
| 4885 | } |
| 4886 | |
| 4887 | type LoadInitialMessagesResult = { |
| 4888 | messages: Message[] |
no outgoing calls
no test coverage detected