MCPcopy Create free account
hub / github.com/freecodexyz/free-code / removeInterruptedMessage

Function removeInterruptedMessage

src/cli/print.ts:4875–4885  ·  view source on GitHub ↗
(
  messages: Message[],
  interruptedUserMessage: NormalizedUserMessage,
)

Source from the content-addressed store, hash-verified

4873 * @internal Exported for testing
4874 */
4875export 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
4887type LoadInitialMessagesResult = {
4888 messages: Message[]

Callers 1

runHeadlessStreamingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected