Skip to content

Commit 16b51ac

Browse files
committed
wip
1 parent e9428ba commit 16b51ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/msgfmt/message_box.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,22 @@ func removeAmpMessageBox(msg string) string {
104104
func removeClaudeReportTaskToolCall(msg string) string {
105105
// If we encounter a line starting with `● coder - coder_report_task (MCP)` -- to {
106106
lines := strings.Split(msg, "\n")
107-
toolCallMarkerIdx := -1
107+
toolCallEndIdx := -1
108108
toolCallStartIdx := -1
109109
for i := len(lines) - 1; i >= 0; i-- {
110110
line := strings.TrimSpace(lines[i])
111111
if strings.HasPrefix(line, "● coder - coder_report_task (MCP)") {
112-
toolCallMarkerIdx = i
113-
}
114-
if toolCallMarkerIdx != -1 && line == "{" {
115112
toolCallStartIdx = i
113+
}
114+
if toolCallStartIdx != -1 && line == "{" {
115+
toolCallEndIdx = i
116116
break
117117
}
118118
}
119119
// If we didn't find the marker, return the original message
120-
if toolCallMarkerIdx == -1 {
120+
if toolCallEndIdx == -1 {
121121
return msg
122122
}
123123
// Remove from the opening brace to the marker line (inclusive)
124-
return strings.Join(append(lines[:toolCallStartIdx], lines[toolCallMarkerIdx+1:]...), "\n")
124+
return strings.Join(append(lines[:toolCallStartIdx], lines[toolCallEndIdx+1:]...), "\n")
125125
}

0 commit comments

Comments
 (0)