Skip to content

Remove unreleased max-daily-effective-tokens support across frontmatter, compiler, JS/runtime outputs, and docs - #37137

Merged
pelikhan merged 1 commit into
mainfrom
copilot/remove-max-daily-effective-tokens
Jun 5, 2026
Merged

Remove unreleased max-daily-effective-tokens support across frontmatter, compiler, JS/runtime outputs, and docs#37137
pelikhan merged 1 commit into
mainfrom
copilot/remove-max-daily-effective-tokens

Conversation

CopilotAI commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This PR removes the unreleased max-daily-effective-tokens path end-to-end and standardizes daily guardrail configuration on max-daily-ai-credits only. No compatibility fallback for the legacy field is retained.

  • Frontmatter + schema

    • Removed max-daily-effective-tokens from the main workflow schema and related shared limit defs.
    • Removed typed/frontmatter support for the legacy field.
  • Compiler + parser

    • Deleted legacy resolution/fallback logic in daily guardrail handling.
    • Import merging now reads only max-daily-ai-credits (no deprecated-field first-wins path).
    • Updated guardrail validation/comments to reflect single-field behavior.
  • CLI enterprise defaults

    • Removed default_max_daily_effective_tokens handling from gh aw env defaults file parsing, validation, and bindings.
    • Removed deprecated compiler env symbol/function (GH_AW_DEFAULT_MAX_DAILY_EFFECTIVE_TOKENS path).
  • Workflow/runtime artifacts + docs

    • Replaced legacy frontmatter/env naming in workflow markdown sources and regenerated lock/golden outputs.
    • Updated docs to remove deprecated guidance and reference only max-daily-ai-credits / default_max_daily_ai_credits.
# beforemax-daily-effective-tokens: 100Mdefault_max_daily_effective_tokens: "15M"GH_AW_DEFAULT_MAX_DAILY_EFFECTIVE_TOKENS=15M# aftermax-daily-ai-credits: 100Mdefault_max_daily_ai_credits: "15M"GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS=15M

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title Remove unreleased max-daily-effective-tokens supportRemove unreleased max-daily-effective-tokens support across frontmatter, compiler, JS/runtime outputs, and docsJun 5, 2026
CopilotAI requested a review from pelikhanJune 5, 2026 15:32
@pelikhan
pelikhan marked this pull request as ready for review June 5, 2026 15:41
CopilotAI review requested due to automatic review settings June 5, 2026 15:41

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the unreleased max-daily-effective-tokens configuration path end-to-end and standardizes daily guardrail configuration on max-daily-ai-credits only, including schema/frontmatter parsing, compiler env/defaults, generated workflow artifacts, and documentation.

Changes:

  • Removed max-daily-effective-tokens from the main workflow JSON schema, Go frontmatter types, and import-field extraction/merging.
  • Updated compiler/runtime wiring and golden outputs to use GH_AW_MAX_DAILY_AI_CREDITS and gate guardrail-related steps on that variable.
  • Updated reference docs and internal .github/aw/* docs to remove deprecated guidance and reference only max-daily-ai-credits / GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS / default_max_daily_ai_credits.
Show a summary per file
FileDescription
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_AllEngines/pi.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_AllEngines/gemini.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.goldenGolden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env.
pkg/workflow/frontmatter_types.goRemoved typed frontmatter field for deprecated max-daily-effective-tokens.
pkg/workflow/daily_effective_workflow.goDropped deprecated-field fallback and standardized resolution/validation on max-daily-ai-credits.
pkg/workflow/daily_effective_workflow_guardrail_test.goRemoved test coverage for deprecated max-daily-effective-tokens fallback.
pkg/workflow/compilerenv/manager.goRemoved deprecated enterprise env var constant/function for daily effective tokens.
pkg/workflow/compilerenv/manager_test.goRemoved tests for deprecated daily effective tokens enterprise default resolver.
pkg/parser/schemas/main_workflow_schema.jsonRemoved deprecated max-daily-effective-tokens from schema and shared defs.
pkg/parser/import_processor.goUpdated import merge comment to reflect max-daily-ai-credits only.
pkg/parser/import_field_extractor.goRemoved import extraction of deprecated max-daily-effective-tokens.
pkg/parser/import_field_extractor_test.goUpdated tests to no longer include deprecated import field.
pkg/cli/env_command.goRemoved defaults-file key/binding/validation for default_max_daily_effective_tokens.
pkg/cli/env_command_test.goUpdated env defaults YAML key assertions and update-change ordering after removal.
docs/src/content/docs/reference/glossary.mdUpdated glossary mentions of GH_AW_DEFAULT_* to remove deprecated daily ET default var.
docs/src/content/docs/reference/frontmatter.mdRemoved deprecation note for max-daily-effective-tokens and kept max-daily-ai-credits as the single field.
docs/src/content/docs/reference/environment-variables.mdUpdated defaults YAML key examples to use default_max_daily_ai_credits.
docs/src/content/docs/reference/cost-management.mdUpdated examples and enterprise defaults section to refer to AI credits naming.
docs/src/content/docs/reference/compiler-enterprise-environment-controls.mdUpdated enterprise env var table and examples to use GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS.
docs/adr/36496-centralize-effective-token-limit-parsing.mdADR updated to reference max-daily-ai-credits instead of deprecated field.
docs/adr/36179-gate-daily-et-guardrail-on-configuration.mdADR updated to reference GH_AW_MAX_DAILY_AI_CREDITS gating expression and field name.
.github/workflows/daily-mcp-concurrency-analysis.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-malicious-code-scan.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-malicious-code-scan.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-issues-report.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-hippo-learn.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-grafana-otel-instrumentation-advisor.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-geo-optimizer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-geo-optimizer.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-function-namer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-firewall-report.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-file-diet.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-fact.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-experiment-report.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-doc-updater.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-doc-healer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-compiler-threat-spec-optimizer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-compiler-quality.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-community-attribution.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-code-metrics.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-cli-tools-tester.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-cli-tools-tester.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-cli-performance.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-choice-test.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-caveman-optimizer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-cache-strategy-analyzer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-byok-ollama-test.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-byok-ollama-test.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-aw-cross-repo-compile-check.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-astrostylelite-markdown-spellcheck.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-assign-issue-to-user.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-assign-issue-to-user.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-architecture-diagram.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-ambient-context-optimizer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-ambient-context-optimizer.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/daily-agentrx-trace-optimizer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/daily-agent-of-the-day-blog-writer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/craft.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-session-insights.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-pr-prompt-analysis.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-pr-nlp-analysis.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-pr-merged-report.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-pr-merged-report.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/copilot-opt.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-opt.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/copilot-cli-deep-research.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/copilot-cli-deep-research.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/copilot-agent-analysis.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/contribution-check.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/contribution-check.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/constraint-solving-potd.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/constraint-solving-potd.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/commit-changes-analyzer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/codex-github-remote-mcp-test.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/code-simplifier.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/code-scanning-fixer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/cloclo.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/cli-version-checker.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/cli-version-checker.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/cli-consistency-checker.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/cli-consistency-checker.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/claude-code-user-docs-review.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ci-doctor.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ci-coach.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/chaos-pr-bundle-fuzzer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/changeset.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/breaking-change-checker.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/breaking-change-checker.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/brave.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/bot-detection.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/bot-detection.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/blog-auditor.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/blog-auditor.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/aw-failure-investigator.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/avenger.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/auto-triage-issues.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/auto-triage-issues.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/audit-workflows.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/artifacts-summary.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/artifacts-summary.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/architecture-guardian.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/architecture-guardian.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/workflows/archie.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/approach-validator.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/api-consumption-report.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ai-moderator.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/agent-persona-explorer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/agent-performance-analyzer.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ace-editor.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ace-editor.lock.ymlRegenerated lock file reflecting updated prompt/env content.
.github/workflows/ab-testing-advisor.mdWorkflow frontmatter updated to max-daily-ai-credits.
.github/workflows/ab-testing-advisor.lock.ymlRegenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates.
.github/aw/token-optimization.mdUpdated internal guidance to use max-daily-ai-credits naming.
.github/aw/syntax-agentic.mdUpdated internal syntax reference to use max-daily-ai-credits naming.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

pkg/workflow/daily_effective_workflow.go:81

  • resolveMaxDailyEffectiveTokens currently falls back to a hard-coded default of "500000" when neither frontmatter nor imports provide max-daily-ai-credits. This makes the guardrail effectively enabled even when the key is omitted, which conflicts with the schema/documentation that says omission leaves the guardrail disabled (e.g. pkg/parser/schemas/main_workflow_schema.json:3696 and docs/src/content/docs/reference/frontmatter.md:252), and with the user-facing report guidance that says removing the key can result in no per-workflow cap (actions/setup/md/daily_effective_workflow_exceeded.md:64). Please reconcile the intended default behavior (disable-by-default vs built-in default) and update the compiler + docs/schema accordingly.
  • Files reviewed: 170/170 changed files
  • Comments generated: 3

Comment on lines 103 to 108
func hasWorkflowExplicitMaxDailyEffectiveTokensDisable(data *WorkflowData) bool {
if data == nil || data.RawFrontmatter == nil {
return false
}
if isMaxDailyEffectiveTokensDisabled(data.RawFrontmatter[maxDailyAICreditsField]) {
return true
}
return isMaxDailyEffectiveTokensDisabled(data.RawFrontmatter[maxDailyEffectiveTokensField])
return isMaxDailyEffectiveTokensDisabled(data.RawFrontmatter[maxDailyAICreditsField])
}

- **`max-effective-tokens:`** — Per-run ET budget enforced by the AWF firewall/API proxy (default `25000000`). The agent is steered to stay within budget; set a negative value to disable enforcement and steering.
- **`max-daily-effective-tokens:`** — Per-user 24-hour guardrail. At activation, gh-aw sums the triggering user's ET across their runs of this workflow over the last 24 hours and blocks execution once the total exceeds the threshold. Enabled by default with a system default threshold; set `-1` to disable, or an explicit value to override the default.
- **`max-daily-ai-credits:`** — Per-user 24-hour guardrail. At activation, gh-aw sums the triggering user's ET across their runs of this workflow over the last 24 hours and blocks execution once the total exceeds the threshold. Enabled by default with a system default threshold; set `-1` to disable, or an explicit value to override the default.
- **`max-turns:`** - AWF turn cap applied consistently across all agentic engines (integer or expression, e.g. `${{ inputs.max-turns }}`). The engine-level `engine.max-turns` is a deprecated alias kept for backward compatibility — prefer this top-level field. Not supported by the `gemini` engine.
- **`max-effective-tokens:`** - Per-run effective-token (ET) budget enforced by the AWF firewall (integer or `K`/`M` short-form string like `100M`; default `25000000`). Set a negative value to disable enforcement and token steering. See [token-optimization.md](token-optimization.md).
- **`max-daily-effective-tokens:`** - Per-user 24-hour ET guardrail: activation blocks execution once the triggering user's aggregated ET for this workflow over the last 24h exceeds the threshold (integer or `K`/`M` short-form string, or `-1`). Enabled by default with a system default threshold; set `-1` to disable or an explicit value to override. See [token-optimization.md](token-optimization.md).
- **`max-daily-ai-credits:`** - Per-user 24-hour ET guardrail: activation blocks execution once the triggering user's aggregated ET for this workflow over the last 24h exceeds the threshold (integer or `K`/`M` short-form string, or `-1`). Enabled by default with a system default threshold; set `-1` to disable or an explicit value to override. See [token-optimization.md](token-optimization.md).
@pelikhan
pelikhan merged commit 2331d48 into mainJun 5, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/remove-max-daily-effective-tokens branch June 5, 2026 15:53
@github-actions

Copy link
Copy Markdown
Contributor

@copilot review all comments and reconcile the intended default behavior for max-daily-ai-credits with the schema/docs.

Then summarize the remaining blockers.

Generated by 👨‍🍳 PR Sous Chef · 81 AIC ·

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@pelikhan