MCPcopy Create free account
hub / github.com/github/gh-aw / buildDailyAICExceededContext

Function buildDailyAICExceededContext

actions/setup/js/handle_agent_failure.cjs:1860–1875  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

1858 * @returns {string} Formatted context string, or empty string if no failure
1859 */
1860function 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

Callers 2

mainFunction · 0.85

Calls 3

getPromptPathFunction · 0.85
formatAICCreditsFunction · 0.85
renderTemplateFromFileFunction · 0.85

Tested by

no test coverage detected