(content string, isError bool)
| 122 | } |
| 123 | |
| 124 | func RenderBashToolResult(content string, isError bool) string { |
| 125 | if isError { |
| 126 | return "Bash failed: " + truncateString(content, 150) |
| 127 | } |
| 128 | if strings.HasPrefix(content, "[Exit code:") { |
| 129 | return strings.Split(content, "\n")[0] |
| 130 | } |
| 131 | firstLine := "" |
| 132 | trimmed := strings.TrimSpace(content) |
| 133 | if trimmed != "" { |
| 134 | firstLine = strings.Split(trimmed, "\n")[0] |
| 135 | } |
| 136 | firstLine = truncateString(firstLine, 150) |
| 137 | if firstLine == "" { |
| 138 | return "(empty output)" |
| 139 | } |
| 140 | return firstLine |
| 141 | } |
| 142 | |
| 143 | func RenderGroupedBashToolUse(inputs []BashInput) string { |
| 144 | if len(inputs) == 0 { |
nothing calls this directly
no test coverage detected