summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-20 09:00:28 -0500
committeradamdottv <[email protected]>2025-06-20 09:00:28 -0500
commit7b0329f67f98ccddc1625761a58c4e22cd47573c (patch)
treef69b8db8e0ccbb3fa20e276934c81456de1236db
parent311b9c74dd1b1d853f8fee0f9d54182bde3beee5 (diff)
downloadopencode-7b0329f67f98ccddc1625761a58c4e22cd47573c.tar.gz
opencode-7b0329f67f98ccddc1625761a58c4e22cd47573c.zip
fix(tui): fetch tool more defensive
-rw-r--r--packages/tui/internal/components/chat/message.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index a315dd4ac..ea08d9317 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/packages/tui/internal/components/chat/message.go
@@ -417,12 +417,14 @@ func renderToolInvocation(
toolArgs = renderArgs(&toolArgsMap, "url")
title = fmt.Sprintf("FETCH %s", toolArgs)
if format, ok := toolArgsMap["format"].(string); ok {
- body = *result
- body = truncateHeight(body, 10)
- if format == "html" || format == "markdown" {
- body = toMarkdown(body, innerWidth, t.BackgroundSubtle())
+ if result != nil {
+ body = *result
+ body = truncateHeight(body, 10)
+ if format == "html" || format == "markdown" {
+ body = toMarkdown(body, innerWidth, t.BackgroundSubtle())
+ }
+ body = renderContentBlock(body, WithFullWidth(), WithMarginBottom(1))
}
- body = renderContentBlock(body, WithFullWidth(), WithMarginBottom(1))
}
case "todowrite":
title = fmt.Sprintf("PLAN")
@@ -604,7 +606,7 @@ func renderToolAction(name string) string {
case "edit":
return "Preparing edit..."
case "webfetch":
- return "Writing fetch..."
+ return "Fetching from the web..."
case "glob":
return "Finding files..."
case "grep":