MCPcopy Create free account
hub / github.com/alibaba/open-code-review / scanCodeCommentResponse

Function scanCodeCommentResponse

internal/scan/coverage_test.go:1378–1399  ·  view source on GitHub ↗
(contents ...string)

Source from the content-addressed store, hash-verified

1376}
1377
1378func scanCodeCommentResponse(contents ...string) *llm.ChatResponse {
1379 comments := make([]string, 0, len(contents))
1380 for _, content := range contents {
1381 comments = append(comments, fmt.Sprintf(`{"content":%q}`, content))
1382 }
1383 arguments := `{"comments":[` + strings.Join(comments, ",") + `]}`
1384 return &llm.ChatResponse{
1385 Choices: []llm.Choice{{
1386 Message: llm.ResponseMessage{
1387 ToolCalls: []llm.ToolCall{{
1388 ID: "comment",
1389 Type: "function",
1390 Function: llm.FunctionCall{
1391 Name: "code_comment",
1392 Arguments: arguments,
1393 },
1394 }},
1395 },
1396 }},
1397 Usage: &llm.UsageInfo{PromptTokens: 10, CompletionTokens: 5},
1398 }
1399}
1400
1401func TestDispatchSubtasks_PersistsDedupedCommentsForResume(t *testing.T) {
1402 testHome := t.TempDir()

Calls

no outgoing calls

Tested by

no test coverage detected