MCPcopy Index your code
hub / github.com/kirodotdev/Kiro / generateAcknowledgmentComment

Function generateAcknowledgmentComment

scripts/bedrock_comment_generator.ts:216–243  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  issueNumber: number,
  issueTitle: string,
  issueBody: string,
  classification: ClassificationResult,
  githubToken: string
)

Source from the content-addressed store, hash-verified

214 * Generate acknowledgment comment using Bedrock Claude Opus 4.6
215 */
216export async function generateAcknowledgmentComment(
217 owner: string,
218 repo: string,
219 issueNumber: number,
220 issueTitle: string,
221 issueBody: string,
222 classification: ClassificationResult,
223 githubToken: string
224): Promise<string> {
225 // Sanitize and truncate inputs
226 const sanitizedTitle = issueTitle.substring(0, MAX_TITLE_LENGTH);
227 const sanitizedBody = issueBody.substring(0, MAX_BODY_LENGTH);
228 const labels = classification.recommended_labels.join(", ") || "pending-triage";
229
230 // Fetch existing comments
231 const issueComments = await fetchIssueComments(owner, repo, issueNumber, githubToken);
232
233 const client = createBedrockClient();
234 const prompt = buildCommentPrompt(sanitizedTitle, sanitizedBody, issueComments, labels);
235
236 try {
237 const responseBody = await invokeBedrockWithFallback(client, prompt);
238 return parseCommentResponse(responseBody);
239 } catch (error) {
240 console.error("Error generating acknowledgment comment with Bedrock:", error);
241 throw error;
242 }
243}
244
245/**
246 * Get fallback comment when Bedrock fails

Callers 1

Calls 5

fetchIssueCommentsFunction · 0.85
buildCommentPromptFunction · 0.85
parseCommentResponseFunction · 0.85
createBedrockClientFunction · 0.70

Tested by

no test coverage detected