Include detection AIC in no-op comment footer totals#37446
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Fix no-op comment footer to include detection AIC cost
Include detection AIC in no-op comment footer totals
Jun 7, 2026
Copilot created this pull request from a session on behalf of
pelikhan
June 7, 2026 00:12
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes underreporting of AI Credits (AIC) in no-op tracking comment footers by including threat-detection AIC in the total when threat detection is enabled, ensuring no-op runs reflect the full cost of the workflow’s agent + detection phases.
Changes:
- Updated the no-op footer renderer to compute
totalAIC = agentAIC + threatDetectionAIC(positive finite values only) and render that combined total. - Wired
GH_AW_THREAT_DETECTION_AICinto the conclusion job’s “Process no-op messages” step when the detection job is enabled. - Added regression tests covering both the JS footer total rendering and the Go compiler’s env-var emission.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/notify_comment.go | Passes detection AIC into the no-op conclusion step via GH_AW_THREAT_DETECTION_AIC when detection is enabled. |
| pkg/workflow/detection_success_test.go | Verifies compiled YAML includes the detection AIC env var for the no-op step in the conclusion job. |
| actions/setup/js/handle_noop_message.cjs | Updates footer AIC suffix computation to sum agent + detection AIC. |
| actions/setup/js/handle_noop_message.test.cjs | Adds a test asserting combined AIC appears in the rendered no-op footer and ensures env cleanup. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
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.
No-op tracking comments were only showing agent AIC, so workflows with threat detection underreported total detection cost in the footer. This change makes the no-op footer report combined AIC when detection is enabled.
Footer cost aggregation
handle_noop_message.cjsnow computes footer AIC as:agent AIC + threat-detection AIC(using positive numeric values only).· {value} AIC), but now reflects full no-op run cost.Workflow env wiring for no-op step
GH_AW_THREAT_DETECTION_AICfromneeds.detection.outputs.aicwhen detection is enabled.Regression coverage