Skip to content

Commit a526f0d

Browse files
committed
feat: temporarily remove report_task tool call logging
1 parent 44408b4 commit a526f0d

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

lib/httpapi/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func NewServer(ctx context.Context, config ServerConfig) (*Server, error) {
226226
humaConfig.Info.Description = "HTTP API for Claude Code, Goose, and Aider.\n\nhttps://github.com/coder/agentapi"
227227
api := humachi.New(router, humaConfig)
228228
formatMessage := func(message string, userInput string) string {
229-
return mf.FormatAgentMessage(config.AgentType, message, userInput, logger)
229+
return mf.FormatAgentMessage(config.AgentType, message, userInput)
230230
}
231231

232232
isAgentReadyForInitialPrompt := func(message string) bool {

lib/msgfmt/message_box.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package msgfmt
22

33
import (
4-
"log/slog"
54
"strings"
65
)
76

@@ -102,7 +101,7 @@ func removeAmpMessageBox(msg string) string {
102101
return formattedMsg
103102
}
104103

105-
func removeClaudeReportTaskToolCall(msg string, logger *slog.Logger) string {
104+
func removeClaudeReportTaskToolCall(msg string) string {
106105
// Remove all tool calls that start with `● coder - coder_report_task (MCP)` till we encounter the next line starting with ●
107106
lines := strings.Split(msg, "\n")
108107

@@ -146,10 +145,6 @@ func removeClaudeReportTaskToolCall(msg string, logger *slog.Logger) string {
146145
idxPair := toolCallIdxs[i]
147146
start, end := idxPair[0], idxPair[1]
148147

149-
// Capture the tool call content before removing it
150-
toolCallContent := strings.Join(lines[start:end], "\n")
151-
logger.Info("Removing tool call", "content", toolCallContent)
152-
153148
lines = append(lines[:start], lines[end:]...)
154149
}
155150

lib/msgfmt/msgfmt.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package msgfmt
22

33
import (
4-
"log/slog"
54
"strings"
65
)
76

@@ -255,10 +254,10 @@ func formatGenericMessage(message string, userInput string, agentType AgentType)
255254
return message
256255
}
257256

258-
func formatClaudeMessage(message string, userInput string, logger *slog.Logger) string {
257+
func formatClaudeMessage(message string, userInput string) string {
259258
message = RemoveUserInput(message, userInput, AgentTypeClaude)
260259
message = removeMessageBox(message)
261-
message = removeClaudeReportTaskToolCall(message, logger)
260+
message = removeClaudeReportTaskToolCall(message)
262261
message = trimEmptyLines(message)
263262
return message
264263
}
@@ -284,10 +283,10 @@ func formatAmpMessage(message string, userInput string) string {
284283
return message
285284
}
286285

287-
func FormatAgentMessage(agentType AgentType, message string, userInput string, logger *slog.Logger) string {
286+
func FormatAgentMessage(agentType AgentType, message string, userInput string) string {
288287
switch agentType {
289288
case AgentTypeClaude:
290-
return formatClaudeMessage(message, userInput, logger)
289+
return formatClaudeMessage(message, userInput)
291290
case AgentTypeGoose:
292291
return formatGenericMessage(message, userInput, agentType)
293292
case AgentTypeAider:

lib/msgfmt/msgfmt_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package msgfmt
22

33
import (
44
"embed"
5-
"log/slog"
65
"path"
76
"strings"
87
"testing"
@@ -234,7 +233,7 @@ func TestFormatAgentMessage(t *testing.T) {
234233
assert.NoError(t, err)
235234
expected, err := testdataDir.ReadFile(path.Join(dir, string(agentType), c.Name(), "expected.txt"))
236235
assert.NoError(t, err)
237-
assert.Equal(t, string(expected), FormatAgentMessage(agentType, string(msg), string(userInput), slog.Default()))
236+
assert.Equal(t, string(expected), FormatAgentMessage(agentType, string(msg), string(userInput)))
238237
})
239238
}
240239
})

0 commit comments

Comments
 (0)