You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -2399,23 +2391,7 @@ export class AIProviderService implements Disposable {
2399
2391
2400
2392
for(constcommitofcommits){
2401
2393
if(!commit.hunks||!Array.isArray(commit.hunks)){
2402
-
consterrorMessage='Invalid commit structure: missing or invalid hunks array';
2403
-
constretryPrompt=dedent(`
2404
-
Your previous response has an invalid commit structure. Each commit must have "message", "explanation", and "hunks" properties, where "hunks" is an array of objects with "hunk" numbers.
2405
-
2406
-
Here was your previous response:
2407
-
${rq.content}
2408
-
2409
-
Please provide a valid JSON array of commits following this structure:
@@ -2505,21 +2469,22 @@ export class AIProviderService implements Disposable {
2505
2469
return{isValid: true,commits: commits};
2506
2470
}catch{
2507
2471
// Handle any errors during hunk validation (e.g., malformed commit structure)
2508
-
consterrorMessage='Invalid commit structure in commits result';
2472
+
consterrorMessage='Invalid response from the AI model';
2509
2473
constretryPrompt=dedent(`
2510
-
Your previous response has an invalid commit structure. Each commit must have "message", "explanation", and "hunks" properties, where "hunks" is an array of objects with "hunk" numbers.
2474
+
Your previous response has an invalid commit structure. Ensure each commit has "message", "explanation", and "hunks" properties, where "hunks" is an array of objects with "hunk" numbers.
2511
2475
2512
-
Here was your previous response:
2513
-
${rq.content}
2514
-
2515
-
Please provide a valid JSON array of commits following this structure:
2476
+
Please provide the valid JSON structure below inside a <output> tag and include no other text:
2477
+
<output>
2516
2478
[
2517
-
{
2518
-
"message": "commit message",
2519
-
"explanation": "detailed explanation",
2520
-
"hunks": [{"hunk": 1}, {"hunk": 2}]
2521
-
}
2479
+
{
2480
+
"message": "[commit message here]",
2481
+
"explanation": "[detailed explanation of changes here]",
2482
+
"hunks": [{"hunk": [index from hunk_map]}, {"hunk": [index from hunk_map]}]
2483
+
}
2522
2484
]
2485
+
</output>
2486
+
2487
+
Text in [] brackets above should be replaced with your own text, not including the brackets. Return only the <output> tag and no other text.
template: `You are an advanced AI programming assistant tasked with organizing code changes into commits. Your goal is to create a complete set of commits that are related, grouped logically, atomic, and easy to review. You will be working with individual code hunks and may have some existing commits that already have hunks assigned.
377
377
@@ -413,42 +413,27 @@ Output your complete commit organization as a JSON array. Each commit in the arr
413
413
- "hunks": An array of objects, each representing a hunk in the commit. Each hunk object should have:
414
414
- "hunk": The hunk index (number) from the hunk_map
415
415
416
-
Here's an example of the expected JSON structure:
417
-
416
+
Write the JSON structure below inside a <output> tag and include no other text:
417
+
<output>
418
418
[
419
-
{
420
-
"message": "feat: add user authentication",
421
-
"explanation": "Implements user login and registration functionality with proper validation",
422
-
"hunks": [
423
-
{
424
-
"hunk": 1
425
-
},
426
-
{
427
-
"hunk": 3
428
-
}
429
-
]
430
-
},
431
-
{
432
-
"message": "fix: handle edge cases in validation",
433
-
"explanation": "Adds proper error handling for invalid input scenarios",
434
-
"hunks": [
435
-
{
436
-
"hunk": 2
437
-
}
438
-
]
439
-
}
419
+
{
420
+
"message": "[commit message here]",
421
+
"explanation": "[detailed explanation of changes here]",
422
+
"hunks": [{"hunk": [index from hunk_map]}, {"hunk": [index from hunk_map]}]
423
+
}
440
424
]
425
+
</output>
441
426
442
427
Remember:
428
+
- Text in [] brackets above should be replaced with your own text, not including the brackets
443
429
- Include all existing commits unchanged
444
430
- Organize all unassigned hunks into new commits
445
431
- Every hunk must be assigned to exactly one commit
446
432
- Base your organization on the actual code changes in the hunks
447
433
448
434
\${instructions}
449
435
450
-
Now, proceed with your analysis and organization of the commits. Output only the JSON array containing the complete commit organization, and nothing else.
451
-
Do not include any preceeding or succeeding text or markup, such as "Here are the commits:" or "Here is a valid JSON array of commits:".
436
+
Now, proceed with your analysis and organization of the commits. Return only the <output> tag and no other text.
0 commit comments