File tree Expand file tree Collapse file tree
internal/tui/components/tool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,8 +115,11 @@ func (mv *toolModel) Render(width int) string {
115115 // Add tool result content if available (for completed tools with content)
116116 var resultContent string
117117 if (msg .ToolStatus == types .ToolStatusCompleted || msg .ToolStatus == types .ToolStatusError ) && msg .Content != "" {
118+ style := styles .ToolCallResultStyle
119+
118120 // Calculate available width for content (accounting for padding)
119- availableWidth := max (width - 2 , 10 ) // Minimum readable width
121+ padding := style .Padding ().GetHorizontalPadding ()
122+ availableWidth := max (width - 2 - padding , 10 ) // Minimum readable width
120123
121124 // Wrap long lines to fit the component width
122125 lines := wrapLines (msg .Content , availableWidth )
@@ -125,13 +128,13 @@ func (mv *toolModel) Render(width int) string {
125128 if len (lines ) > 10 {
126129 lines = lines [:10 ]
127130 // Add indicator that content was truncated
128- lines = append (lines , "... (output truncated)" )
131+ lines = append (lines , wrapLines ( "... (output truncated)" , availableWidth ) ... )
129132 }
130133
131134 // Join the lines back and apply muted style
132135 trimmedContent := strings .Join (lines , "\n " )
133136 if trimmedContent != "" {
134- resultContent = "\n " + styles . ToolCallResultStyle .Render (trimmedContent )
137+ resultContent = "\n " + style .Render (trimmedContent )
135138 }
136139 }
137140
You can’t perform that action at this time.
0 commit comments