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
Add auto-fix for incomplete diffs and API response monitoring
- Add stop_reason logging to detect if API response was truncated
- Auto-fix missing +++ b/ lines (inserts correct path from --- a/ line)
- Auto-fix incomplete +++ b/ lines (fixes truncated paths)
- Re-validates diff after auto-fix
- Should handle cases where model stops mid-generation
- Logs API response completion status for debugging
? "Diff appears to be truncated mid-file-path (model stopped generating)"
1063
-
: "Diff appears to be truncated (likely hit token limit)";
1064
-
consterrorMsg=`${truncationReason}. The AI model may have generated an incomplete diff.\n\nErrors:\n${validationResult.errors.join('\n')}\n\nDiff preview (last 500 chars):\n\`\`\`\n${diff.substring(Math.max(0,diffLength-500))}\n\`\`\`\n\nPossible causes:\n- Model hit output token limit (check max_tokens setting)\n- Low API credits causing early termination\n- Input context too large, leaving insufficient room for output\n- Model stopped generating for other reasons\n\nSuggestions:\n- Check Anthropic account credits\n- Reduce input context size (fewer files)\n- Break task into smaller parts\n- Verify max_tokens is sufficient (currently 180K)`;
? "Diff appears to be truncated mid-file-path (model stopped generating)"
1115
+
: "Diff appears to be truncated (likely hit token limit)";
1116
+
consterrorMsg=`${truncationReason}. The AI model may have generated an incomplete diff.\n\nErrors:\n${validationResult.errors.join('\n')}\n\nDiff preview (last 500 chars):\n\`\`\`\n${diff.substring(Math.max(0,diffLength-500))}\n\`\`\`\n\nPossible causes:\n- Model hit output token limit (check max_tokens setting)\n- Input context too large, leaving insufficient room for output\n- Model stopped generating for other reasons\n\nSuggestions:\n- Reduce input context size (fewer files) - already reduced to 400KB\n- Break task into smaller parts\n- Verify max_tokens is sufficient (currently 180K)`;
0 commit comments