Fix empty AIC cells in daily guardrail summary when no prior runs exist in 24h window#38304
Merged
Merged
Conversation
…24h window Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate missing data in AI Credit usage
Fix empty AIC cells in daily guardrail summary when no prior runs exist in 24h window
Jun 10, 2026
mnkiefer
approved these changes
Jun 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the daily AI Credits (AIC) guardrail summary rendering when there are no completed runs in the 24-hour inspection window, avoiding misleading empty table cells caused by formatAICCredits(0) returning an empty string.
Changes:
- Updates
renderDailyAICSummaryto render explicit fallback values for the “zero prior runs” case (e.g.,24h total AIC→0, and stats that are undefined without data →—). - Adds a unit test covering the zero-runs rendering to ensure the markdown includes
0/—rather than blank cells.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/check_daily_aic_workflow_guardrail.cjs | Adds stats.count === 0 handling and formatted fallbacks for AIC summary stats to avoid empty markdown cells. |
| actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs | Adds a test validating correct markdown output when no prior runs exist in the 24h window. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Collaborator
|
@copilot Fix tests and lint errors |
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Contributor
Author
Fixed in the latest commit. The previous commit accidentally merged two template literal lines together (missing a comma between them), causing a |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the daily AIC guardrail finds no completed runs within the 24-hour window, all stats are zero.
formatAIC(0)intentionally returns"", leaving the summary table with blank cells for total, average, std dev, and min/max AIC — visually indistinguishable from missing data.Changes
renderDailyAICSummary: detectstats.count === 0and render explicit fallbacks instead of relying onformatAICCreditsto produce something meaningful for zero values:24h total AIC→"0"(correct: no credits consumed)Avg AIC / run,Std dev AIC,Min / Max AIC→"—"(undefined without data points)check_daily_aic_workflow_guardrail.test.cjs: adds a dedicated test asserting the zero-runs rendering produces0and—values rather than empty strings.