summaryrefslogtreecommitdiffhomepage
path: root/packages/tui
diff options
context:
space:
mode:
authorMariano Uvalle <[email protected]>2025-08-15 04:16:40 -0700
committerGitHub <[email protected]>2025-08-15 06:16:40 -0500
commit0befc5d602dc6306c86a450b1956c66543162a82 (patch)
tree8ce6542fee47e1b877aac2413e72d6d4495e5774 /packages/tui
parent8355ee2061a8f4f6f8e0450dfe4c6aa91b29ab90 (diff)
downloadopencode-0befc5d602dc6306c86a450b1956c66543162a82.tar.gz
opencode-0befc5d602dc6306c86a450b1956c66543162a82.zip
Feat: Render tool metadata after permission rejection. (#1949)
Signed-off-by: jmug <[email protected]>
Diffstat (limited to 'packages/tui')
-rw-r--r--packages/tui/internal/components/chat/message.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index 188dfee87..c72ad6e24 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/packages/tui/internal/components/chat/message.go
@@ -554,6 +554,17 @@ func renderToolDetails(
title := renderToolTitle(toolCall, width)
title = style.Render(title)
content := title + "\n" + body
+
+ if toolCall.State.Status == opencode.ToolPartStateStatusError {
+ errorStyle := styles.NewStyle().
+ Background(backgroundColor).
+ Foreground(t.Error()).
+ Padding(1, 2).
+ Width(width - 4)
+ errorContent := errorStyle.Render(toolCall.State.Error)
+ content += "\n" + errorContent
+ }
+
if permissionContent != "" {
permissionContent = styles.NewStyle().
Background(backgroundColor).
@@ -652,11 +663,17 @@ func renderToolDetails(
}
if error != "" {
- body = styles.NewStyle().
+ errorContent := styles.NewStyle().
Width(width - 6).
Foreground(t.Error()).
Background(backgroundColor).
Render(error)
+
+ if body == "" {
+ body = errorContent
+ } else {
+ body += "\n\n" + errorContent
+ }
}
if body == "" && error == "" && result != nil {