* Build a context string when the 24-hour per-workflow AIC guardrail prevented the agent from * starting in the activation job. * @param {boolean} hasDailyAICExceeded - Whether the daily workflow quota was exceeded * @param {string} totalAIC - Aggregated AIC usage across the last 24 hours * @par
(hasDailyAICExceeded, totalAIC, threshold)
| 1858 | * @returns {string} Formatted context string, or empty string if no failure |
| 1859 | */ |
| 1860 | function buildDailyAICExceededContext(hasDailyAICExceeded, totalAIC, threshold) { |
| 1861 | if (!hasDailyAICExceeded) { |
| 1862 | return ""; |
| 1863 | } |
| 1864 | |
| 1865 | const templatePath = getPromptPath("daily_workflow_aic_exceeded.md"); |
| 1866 | const formattedTotalAIC = formatAICCredits(totalAIC); |
| 1867 | const formattedThreshold = formatAICCredits(threshold); |
| 1868 | return ( |
| 1869 | "\n" + |
| 1870 | renderTemplateFromFile(templatePath, { |
| 1871 | total_aic: formattedTotalAIC || "unknown", |
| 1872 | threshold: formattedThreshold || "unknown", |
| 1873 | }) |
| 1874 | ); |
| 1875 | } |
| 1876 | |
| 1877 | /** |
| 1878 | * Build the "Optimize token consumption" details section for the failure issue when a guardrail |
no test coverage detected