diff --git a/chat.go b/chat.go index 7ef2610..1179cfb 100644 --- a/chat.go +++ b/chat.go @@ -409,6 +409,10 @@ func SplitImagePairs(text string) []openrouter.ChatMessagePart { ) push := func(str, end int) { + if str > end { + return + } + rest := text[str:end] if rest == "" {