* Build a context string when assigning the Copilot coding agent to created issues failed. * @param {boolean} hasAssignCopilotFailures - Whether any copilot assignments failed * @param {string} assignCopilotErrors - Newline-separated list of "issue:number:copilot:error" entries * @returns {string
(hasAssignCopilotFailures, assignCopilotErrors)
| 2124 | * @returns {string} Formatted context string, or empty string if no failures |
| 2125 | */ |
| 2126 | function buildAssignCopilotFailureContext(hasAssignCopilotFailures, assignCopilotErrors) { |
| 2127 | if (!hasAssignCopilotFailures) { |
| 2128 | return ""; |
| 2129 | } |
| 2130 | |
| 2131 | // Build a list of failed issue assignments |
| 2132 | let issueList = ""; |
| 2133 | if (assignCopilotErrors) { |
| 2134 | const errorLines = assignCopilotErrors.split("\n").filter(line => line.trim()); |
| 2135 | for (const errorLine of errorLines) { |
| 2136 | const parts = errorLine.split(":"); |
| 2137 | if (parts.length >= 4) { |
| 2138 | const number = parts[1]; |
| 2139 | const error = parts.slice(3).join(":"); // Rest is the error message |
| 2140 | issueList += `- Issue #${number}: ${error}\n`; |
| 2141 | } |
| 2142 | } |
| 2143 | } |
| 2144 | |
| 2145 | const templatePath = getPromptPath("assign_copilot_to_created_issues_failure.md"); |
| 2146 | return "\n" + renderTemplateFromFile(templatePath, { issues: issueList }); |
| 2147 | } |
| 2148 | |
| 2149 | /** |
| 2150 | * Build a context string when frontmatter skill installation failed. |
no test coverage detected