From 842f0a8d86b11138a3fe2d9b0d197826f5114ede Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 07:43:00 +0000 Subject: [PATCH 1/4] Initial plan From 07318928dda6abfc2af9ba60d4c6bda3c009df77 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 07:55:16 +0000 Subject: [PATCH 2/4] Fix empty AIC cells in daily guardrail summary when no prior runs in 24h window Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .../js/check_daily_aic_workflow_guardrail.cjs | 14 ++++++--- ...heck_daily_aic_workflow_guardrail.test.cjs | 30 +++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs index 34024b592f0..eb770afc8bf 100644 --- a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs +++ b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs @@ -223,6 +223,12 @@ function renderDailyAICSummary(workflowName, actorLogin, threshold, countedRuns, .join("\n") : "| _none_ | — | — | 0 |"; + const noRunData = stats.count === 0; + const totalAICFormatted = formatAICCredits(stats.total) || "0"; + const avgAICFormatted = noRunData ? "—" : formatAICCredits(stats.average) || "0"; + const stddevAICFormatted = noRunData ? "—" : formatAICCredits(stats.stddev) || "0"; + const minMaxAICFormatted = noRunData ? "— / —" : `${formatAICCredits(stats.min)} / ${formatAICCredits(stats.max)}`; + const noteLines = []; if (meta.truncatedByRateLimit) { noteLines.push(`- Stopped early to preserve GitHub API rate limit headroom (${rateLimit.remaining} remaining, reserve ${RATE_LIMIT_RESERVE}).`); @@ -236,14 +242,14 @@ function renderDailyAICSummary(workflowName, actorLogin, threshold, countedRuns, "", "| Statistic | Value |", "| --- | ---: |", - `| 24h total AIC | ${formatAICCredits(stats.total)} |`, + `| 24h total AIC | ${totalAICFormatted} |`, `| Threshold | ${formatAICCredits(threshold)} |`, `| Threshold used | ${usagePercent}% |`, `| Remaining headroom | ${formatAICCredits(remainingBudget)} |`, `| Runs counted | ${formatInteger(stats.count)} |`, - `| Avg AIC / run | ${formatAICCredits(stats.average)} |`, - `| Std dev AIC | ${formatAICCredits(stats.stddev)} |`, - `| Min / Max AIC | ${formatAICCredits(stats.min)} / ${formatAICCredits(stats.max)} |`, + `| Avg AIC / run | ${avgAICFormatted} |`, + `| Std dev AIC | ${stddevAICFormatted} |`, + `| Min / Max AIC | ${minMaxAICFormatted} |`, `| API remaining | ${formatInteger(rateLimit.remaining)} / ${formatInteger(rateLimit.limit)} |`, `| API used | ${formatInteger(rateLimit.used)} |`, `| API reset | ${rateLimit.reset || "unknown"} |`, diff --git a/actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs b/actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs index 0d0da854603..4678888a504 100644 --- a/actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs +++ b/actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs @@ -98,6 +98,36 @@ describe("check_daily_aic_workflow_guardrail", () => { expect(exports.formatDailyGuardrailLogMessage("Completed AI Credits inspection window")).toBe("[daily-workflow-aic] Completed AI Credits inspection window"); }); + it("renders a daily AI Credits summary with zero counts when no prior runs are in the 24h window", () => { + const markdown = exports.renderDailyAICSummary( + "Impact Efficiency Report", + "mnkiefer", + 5000, + [], + { + remaining: 13194, + limit: 15000, + used: 1806, + reset: "2026-06-10T07:07:04.000Z", + }, + { + candidateRunsCount: 0, + inspectedRunsCount: 0, + truncatedByRateLimit: false, + } + ); + + expect(markdown).toContain("| 24h total AIC | 0 |"); + expect(markdown).toContain("| Runs counted | 0 |"); + expect(markdown).toContain("| Avg AIC / run | — |"); + expect(markdown).toContain("| Std dev AIC | — |"); + expect(markdown).toContain("| Min / Max AIC | — / — |"); + expect(markdown).toContain("| _none_ | — | — | 0 |"); + expect(markdown).not.toContain("| 24h total AIC | |"); + expect(markdown).not.toContain("| Avg AIC / run | |"); + expect(markdown).not.toContain("| Min / Max AIC | / |"); + }); + it("renders a daily AI Credits details summary with stats and prior runs", () => { const markdown = exports.renderDailyAICSummary( "Nightly triage", From ddd2ba92a1617466b131a6a7be4f74d29958c9e6 Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer <8320933+mnkiefer@users.noreply.github.com> Date: Wed, 10 Jun 2026 10:03:02 +0200 Subject: [PATCH 3/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- actions/setup/js/check_daily_aic_workflow_guardrail.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs index eb770afc8bf..e37e1cb6c95 100644 --- a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs +++ b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs @@ -245,7 +245,7 @@ function renderDailyAICSummary(workflowName, actorLogin, threshold, countedRuns, `| 24h total AIC | ${totalAICFormatted} |`, `| Threshold | ${formatAICCredits(threshold)} |`, `| Threshold used | ${usagePercent}% |`, - `| Remaining headroom | ${formatAICCredits(remainingBudget)} |`, + `| Remaining headroom | ${formatAICCredits(remainingBudget) || "0"} |` `| Runs counted | ${formatInteger(stats.count)} |`, `| Avg AIC / run | ${avgAICFormatted} |`, `| Std dev AIC | ${stddevAICFormatted} |`, From 336d5cf4ead9338888face1e714bdc92b14ee7ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 08:14:02 +0000 Subject: [PATCH 4/4] Fix missing comma causing tagged template expression error on line 248 Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- actions/setup/js/check_daily_aic_workflow_guardrail.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs index e37e1cb6c95..a61a5332309 100644 --- a/actions/setup/js/check_daily_aic_workflow_guardrail.cjs +++ b/actions/setup/js/check_daily_aic_workflow_guardrail.cjs @@ -245,7 +245,7 @@ function renderDailyAICSummary(workflowName, actorLogin, threshold, countedRuns, `| 24h total AIC | ${totalAICFormatted} |`, `| Threshold | ${formatAICCredits(threshold)} |`, `| Threshold used | ${usagePercent}% |`, - `| Remaining headroom | ${formatAICCredits(remainingBudget) || "0"} |` + `| Remaining headroom | ${formatAICCredits(remainingBudget) || "0"} |`, `| Runs counted | ${formatInteger(stats.count)} |`, `| Avg AIC / run | ${avgAICFormatted} |`, `| Std dev AIC | ${stddevAICFormatted} |`,