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