Skip to content

Commit 4f9f289

Browse files
fix: change calculation for chunking
1 parent f5be572 commit 4f9f289

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/actions/auto-pr-description/generate_pr_description.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function chunkDiffByFiles(diffContent) {
3434
// Check if this is a new file header
3535
if (line.startsWith('diff --git') || line.startsWith('+++') || line.startsWith('---')) {
3636
// If we have content and it's getting large, save current chunk
37-
if (currentChunk && estimateTokens(currentChunk) > MAX_CHARS_PER_CHUNK / 2) {
37+
if (currentChunk && estimateTokens(currentChunk + '\n' + line) > MAX_TOKENS_PER_REQUEST) {
3838
fileChunks.push({
3939
content: currentChunk.trim(),
4040
file: currentFile,

0 commit comments

Comments
 (0)