(contents ...string)
| 1376 | } |
| 1377 | |
| 1378 | func 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 | |
| 1401 | func TestDispatchSubtasks_PersistsDedupedCommentsForResume(t *testing.T) { |
| 1402 | testHome := t.TempDir() |
no outgoing calls
no test coverage detected