Skip daily AI-credit guardrail for user-initiated and command-routed runs#39123
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
Skip daily AI credits guardrail for manual and command-driven runs
Skip daily AI-credit guardrail for user-initiated and command-routed runs
Jun 13, 2026
Copilot created this pull request from a session on behalf of
pelikhan
June 13, 2026 16:51
View session
Collaborator
|
@copilot use tech writer agent to update docs about exceptions |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the daily max AI-credits guardrail skip logic so that user-intent runs (manual workflow_dispatch, slash commands, label commands, and dispatch-routed command invocations via aw_context) are not blocked by the daily guardrail. It also wires compiler-emitted env flags into the activation job to help the runtime guard script identify non-centralized command-triggered executions.
Changes:
- Updated the guardrail runtime logic (
actions/setup/js/check_daily_aic_workflow_guardrail.cjs) to skip daily guardrail for manual dispatch and command-driven runs, including non-centralized triggers gated by new env flags. - Updated compiler activation-job env wiring to emit
GH_AW_HAS_SLASH_COMMAND/GH_AW_HAS_LABEL_COMMAND, and added integration coverage to ensure the compiled lock output contains these flags. - Refreshed WASM golden fixtures to include the new compiler-emitted env vars.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_activation_job_builder.go | Adds env vars indicating whether slash/label commands are configured for this workflow. |
| actions/setup/js/check_daily_aic_workflow_guardrail.cjs | Adjusts skip semantics for manual + command-driven invocations; adds env flag parsing and event gating. |
| actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs | Expands unit coverage for manual dispatch, command aw_context payloads, malformed context, and non-centralized event gating via env flags. |
| pkg/workflow/daily_aic_workflow_guardrail_skip_integration_test.go | New integration test asserting compiled lock files include the new env flags across scenarios. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_AllEngines/pi.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_AllEngines/gemini.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.golden | Updates golden output to include new env flags (default false). |
| pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden | Updates golden output to include new env flags (default false). |
| .github/workflows/test-quality-sentinel.lock.yml | Regenerated lock workflow (but currently missing the new guardrail env flags in the activation guardrail step). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 14/14 changed files
- Comments generated: 2
Comment on lines
63
to
67
| /** | ||
| * Event types that indicate a user-initiated slash command trigger. | ||
| * When aw_context.event_type is one of these, the workflow was triggered by a user | ||
| * typing a slash command in a comment, and the daily guardrail should not be skipped. | ||
| */ |
| env: | ||
| GH_AW_WORKFLOW_NAME: "Test Quality Sentinel" | ||
| GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e 🧪 *Test quality analysis by [{workflow_name}]({run_url})*{ai_credits_suffix}{history_link}\",\"runStarted\":\"🔬 [{workflow_name}]({run_url}) is analyzing test quality on this {event_type}...\",\"runSuccess\":\"🧪 [{workflow_name}]({run_url}) completed test quality analysis.\",\"runFailure\":\"❌ [{workflow_name}]({run_url}) {status} during test quality analysis.\"}" | ||
| GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e 🧪 *Test quality analysis by [{workflow_name}]({run_url})*{ai_credits_suffix}{history_link}\",\"runStarted\":\"🔬 [{workflow_name}]({run_url}) is analyzing test quality on this {event_type}...\",\"runSuccess\":\"✅ [{workflow_name}]({run_url}) completed test quality analysis.\",\"runFailure\":\"❌ [{workflow_name}]({run_url}) {status} during test quality analysis.\"}" |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in commit 3f8aa9a. The tech writer agent updated two docs files:
|
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.
The daily max AI-credit guardrail was incorrectly applying to runs where users intentionally invoked the workflow (manual dispatch, slash commands, label commands). This updates guardrail bypass semantics so these invocation paths proceed without daily-credit blocking.
Guardrail bypass semantics
workflow_dispatchwithoutaw_contextas manual user intent and bypass daily guardrail.aw_context.Compiler wiring for runtime guard decisions
GH_AW_HAS_SLASH_COMMANDGH_AW_HAS_LABEL_COMMANDCoverage additions
workflow_dispatch