Skip to content

Commit ed93084

Browse files
committed
Reduce the file content inclusion threshold for commit message generation from 1MB to 100KB
1 parent b574656 commit ed93084

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

packages/vscode/src/utils/commit-message-generator.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,11 @@ export async function collect_affected_files_with_metadata(
280280
let is_large_file = false
281281
try {
282282
const stats = await fs.promises.stat(file_path)
283-
if (stats.size > 1024 * 1024) {
284-
// 1MB limit for direct content inclusion
283+
if (stats.size > 100 * 1024) {
285284
is_large_file = true
286285
content = `File content omitted due to large size (${(
287-
stats.size /
288-
(1024 * 1024)
289-
).toFixed(2)} MB).`
286+
stats.size / 1024
287+
).toFixed(2)} KB).`
290288
} else {
291289
content = await fs.promises.readFile(file_path, 'utf8')
292290
}
@@ -411,10 +409,8 @@ export function build_files_content(files_data: FileData[]): string {
411409
}
412410

413411
export function strip_wrapping_quotes(text: string): string {
414-
// Remove leading/trailing whitespace
415412
text = text.trim()
416413

417-
// Check for single quotes
418414
if (
419415
(text.startsWith("'") && text.endsWith("'")) ||
420416
(text.startsWith('"') && text.endsWith('"')) ||
@@ -520,7 +516,6 @@ export async function generate_commit_message_from_diff(
520516
progress_title: string,
521517
diff: string,
522518
api_config?: {
523-
// Make api_config optional parameter
524519
config: CommitMessageConfig
525520
provider: any
526521
endpoint_url: string

0 commit comments

Comments
 (0)