From b2a57bf1eef1391d645de672483c4e479e7566c0 Mon Sep 17 00:00:00 2001 From: Ansel Robateau Date: Mon, 5 Jan 2026 09:56:25 -0600 Subject: [PATCH] fix: increase maxOutputTokens to prevent PR description truncation - 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`'. --- .../generate_pr_description.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/actions/auto-release-description/generate_pr_description.js b/.github/actions/auto-release-description/generate_pr_description.js index 83b064a..7647cf7 100644 --- a/.github/actions/auto-release-description/generate_pr_description.js +++ b/.github/actions/auto-release-description/generate_pr_description.js @@ -150,19 +150,19 @@ ${diffContent}`; * Create the main PR description prompt */ function createPRPrompt(diffContent) { - return `Write a release note summary with the following sections: + return `Write a release note summary with the following sections. Be comprehensive but concise - focus on the most important changes: ## Infrastructure Changes - Highlight changes to AWS resources, IaC (CloudFormation/SAM templates), Lambda functions, databases, and deployment configurations. + Highlight changes to AWS resources, IaC (CloudFormation/SAM templates), Lambda functions, databases, and deployment configurations. Use bullet points for clarity. ## Security Concerns - Identify any security-related changes, authentication/authorization updates, data access modifications, or potential vulnerabilities. + Identify any security-related changes, authentication/authorization updates, data access modifications, or potential vulnerabilities. If none, state "No significant security changes detected." ## Performance Implications - Assess any changes that could impact system performance, database queries, API response times, or resource consumption. + Assess any changes that could impact system performance, database queries, API response times, or resource consumption. If none, state "No significant performance implications detected." ## New Features - Describe new functionality, enhancements, or capabilities being introduced. + Describe new functionality, enhancements, or capabilities being introduced. Use bullet points for multiple features. ## Student Access Risk Analysis 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) { If no student access risks are detected, state: "Risk Level: NONE - No changes affect student material access." + IMPORTANT: Keep the total response under 12,000 tokens. Be comprehensive but concise. Group similar changes together. + Print only the report and ask no questions. ${diffContent}`; @@ -206,7 +208,7 @@ async function callGeminiAPI(prompt, apiKey, retryCount = 0) { temperature: 0.7, topK: 40, topP: 0.95, - maxOutputTokens: 8192, + maxOutputTokens: 16384, } }) });