Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit 8f8b403

Browse files
kujtimiihoxhatermai
andcommitted
Make tool error results visually distinct with red border
- Change tool result border color to red when displaying errors - Keep green border for successful results - Improve visual distinction between error and success states 🤖 Generated with termai Co-Authored-By: termai <noreply@termai.io>
1 parent fa5840c commit 8f8b403

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/tui/components/repl/messages.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,15 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
221221
Bold(true).
222222
Foreground(styles.Green).
223223
Render(fmt.Sprintf("%s Result", styles.CheckIcon))
224+
225+
// Use the same style for both header and border if it's an error
226+
borderColor := styles.Green
224227
if result.IsError {
225228
resultHeader = lipgloss.NewStyle().
226229
Bold(true).
227230
Foreground(styles.Red).
228231
Render(fmt.Sprintf("%s Error", styles.ErrorIcon))
232+
borderColor = styles.Red
229233
}
230234

231235
truncate := 200
@@ -235,7 +239,7 @@ func (m *messagesCmp) renderMessageWithToolCall(content string, tools []message.
235239
}
236240

237241
resultContent := lipgloss.JoinVertical(lipgloss.Left, resultHeader, content)
238-
return toolResultStyle.Render(resultContent)
242+
return toolResultStyle.BorderForeground(borderColor).Render(resultContent)
239243
}
240244

241245
connector := connectorStyle.Render("└─> Tool Calls:")

0 commit comments

Comments
 (0)