The open source coding agent.
TypeScript
fix: tui attachment bound (#2361)
Aiden Cline26f75d4e68a9
diff --git a/packages/tui/internal/app/prompt.go b/packages/tui/internal/app/prompt.goindex 8701a20727f..bd5086a45d2 100644--- a/packages/tui/internal/app/prompt.go+++ b/packages/tui/internal/app/prompt.go@@ -43,6 +43,9 @@ func (p Prompt) ToMessage(}for _, att := range textAttachments {if source, ok := att.GetTextSource(); ok {+ if att.StartIndex > att.EndIndex || att.EndIndex > len(text) {+ continue+ }text = text[:att.StartIndex] + source.Value + text[att.EndIndex:]}}