Skip to content

Commit 7d04955

Browse files
fix: increase maxOutputTokens to prevent PR description truncation (#126)
- Increase maxOutputTokens from 8192 to 16384 tokens - Update prompt to guide AI to be more concise - Add guidance to use bullet points and group similar changes - Prevents release descriptions from being truncated mid-sentence The 8192 token limit (~32KB) was too small for comprehensive release descriptions, causing truncation like 'incremented from `3' instead of 'incremented from `3.22.0` to `3.23.0`'.
1 parent 2d6e53a commit 7d04955

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ ${diffContent}`;
150150
* Create the main PR description prompt
151151
*/
152152
function createPRPrompt(diffContent) {
153-
return `Write a release note summary with the following sections:
153+
return `Write a release note summary with the following sections. Be comprehensive but concise - focus on the most important changes:
154154
155155
## Infrastructure Changes
156-
Highlight changes to AWS resources, IaC (CloudFormation/SAM templates), Lambda functions, databases, and deployment configurations.
156+
Highlight changes to AWS resources, IaC (CloudFormation/SAM templates), Lambda functions, databases, and deployment configurations. Use bullet points for clarity.
157157
158158
## Security Concerns
159-
Identify any security-related changes, authentication/authorization updates, data access modifications, or potential vulnerabilities.
159+
Identify any security-related changes, authentication/authorization updates, data access modifications, or potential vulnerabilities. If none, state "No significant security changes detected."
160160
161161
## Performance Implications
162-
Assess any changes that could impact system performance, database queries, API response times, or resource consumption.
162+
Assess any changes that could impact system performance, database queries, API response times, or resource consumption. If none, state "No significant performance implications detected."
163163
164164
## New Features
165-
Describe new functionality, enhancements, or capabilities being introduced.
165+
Describe new functionality, enhancements, or capabilities being introduced. Use bullet points for multiple features.
166166
167167
## Student Access Risk Analysis
168168
Evaluate the risk that these changes could cause students to lose access to their course materials. Assess changes to:
@@ -178,6 +178,8 @@ function createPRPrompt(diffContent) {
178178
179179
If no student access risks are detected, state: "Risk Level: NONE - No changes affect student material access."
180180
181+
IMPORTANT: Keep the total response under 12,000 tokens. Be comprehensive but concise. Group similar changes together.
182+
181183
Print only the report and ask no questions.
182184
183185
${diffContent}`;
@@ -206,7 +208,7 @@ async function callGeminiAPI(prompt, apiKey, retryCount = 0) {
206208
temperature: 0.7,
207209
topK: 40,
208210
topP: 0.95,
209-
maxOutputTokens: 8192,
211+
maxOutputTokens: 16384,
210212
}
211213
})
212214
});

0 commit comments

Comments
 (0)