Uh oh!
There was an error while loading. Please reload this page.
Remove unreleased max-daily-effective-tokens support across frontmatter, compiler, JS/runtime outputs, and docs - #37137
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
max-daily-effective-tokens support across frontmatter, compiler, JS/runtime outputs, and docsThere was a problem hiding this comment.
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-tokensfrom 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_CREDITSand gate guardrail-related steps on that variable. - Updated reference docs and internal
.github/aw/*docs to remove deprecated guidance and reference onlymax-daily-ai-credits/GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS/default_max_daily_ai_credits.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/pi.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/gemini.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden | Golden output updated to use GH_AW_MAX_DAILY_AI_CREDITS gating/env. |
pkg/workflow/frontmatter_types.go | Removed typed frontmatter field for deprecated max-daily-effective-tokens. |
pkg/workflow/daily_effective_workflow.go | Dropped deprecated-field fallback and standardized resolution/validation on max-daily-ai-credits. |
pkg/workflow/daily_effective_workflow_guardrail_test.go | Removed test coverage for deprecated max-daily-effective-tokens fallback. |
pkg/workflow/compilerenv/manager.go | Removed deprecated enterprise env var constant/function for daily effective tokens. |
pkg/workflow/compilerenv/manager_test.go | Removed tests for deprecated daily effective tokens enterprise default resolver. |
pkg/parser/schemas/main_workflow_schema.json | Removed deprecated max-daily-effective-tokens from schema and shared defs. |
pkg/parser/import_processor.go | Updated import merge comment to reflect max-daily-ai-credits only. |
pkg/parser/import_field_extractor.go | Removed import extraction of deprecated max-daily-effective-tokens. |
pkg/parser/import_field_extractor_test.go | Updated tests to no longer include deprecated import field. |
pkg/cli/env_command.go | Removed defaults-file key/binding/validation for default_max_daily_effective_tokens. |
pkg/cli/env_command_test.go | Updated env defaults YAML key assertions and update-change ordering after removal. |
docs/src/content/docs/reference/glossary.md | Updated glossary mentions of GH_AW_DEFAULT_* to remove deprecated daily ET default var. |
docs/src/content/docs/reference/frontmatter.md | Removed deprecation note for max-daily-effective-tokens and kept max-daily-ai-credits as the single field. |
docs/src/content/docs/reference/environment-variables.md | Updated defaults YAML key examples to use default_max_daily_ai_credits. |
docs/src/content/docs/reference/cost-management.md | Updated examples and enterprise defaults section to refer to AI credits naming. |
docs/src/content/docs/reference/compiler-enterprise-environment-controls.md | Updated enterprise env var table and examples to use GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS. |
docs/adr/36496-centralize-effective-token-limit-parsing.md | ADR updated to reference max-daily-ai-credits instead of deprecated field. |
docs/adr/36179-gate-daily-et-guardrail-on-configuration.md | ADR updated to reference GH_AW_MAX_DAILY_AI_CREDITS gating expression and field name. |
.github/workflows/daily-mcp-concurrency-analysis.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-malicious-code-scan.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-malicious-code-scan.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-issues-report.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-hippo-learn.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-grafana-otel-instrumentation-advisor.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-geo-optimizer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-geo-optimizer.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-function-namer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-firewall-report.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-file-diet.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-fact.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-experiment-report.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-doc-updater.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-doc-healer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-compiler-threat-spec-optimizer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-compiler-quality.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-community-attribution.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-code-metrics.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-cli-tools-tester.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-cli-tools-tester.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-cli-performance.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-choice-test.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-caveman-optimizer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-cache-strategy-analyzer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-byok-ollama-test.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-byok-ollama-test.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-aw-cross-repo-compile-check.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-astrostylelite-markdown-spellcheck.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-assign-issue-to-user.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-assign-issue-to-user.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-architecture-diagram.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-ambient-context-optimizer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-ambient-context-optimizer.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/daily-agentrx-trace-optimizer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/daily-agent-of-the-day-blog-writer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/craft.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-session-insights.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-pr-prompt-analysis.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-pr-nlp-analysis.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-pr-merged-report.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-pr-merged-report.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/copilot-opt.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-opt.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/copilot-cli-deep-research.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/copilot-cli-deep-research.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/copilot-agent-analysis.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/contribution-check.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/contribution-check.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/constraint-solving-potd.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/constraint-solving-potd.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/commit-changes-analyzer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/codex-github-remote-mcp-test.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/code-simplifier.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/code-scanning-fixer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/cloclo.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/cli-version-checker.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/cli-version-checker.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/cli-consistency-checker.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/cli-consistency-checker.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/claude-code-user-docs-review.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ci-doctor.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ci-coach.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/chaos-pr-bundle-fuzzer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/changeset.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/breaking-change-checker.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/breaking-change-checker.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/brave.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/bot-detection.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/bot-detection.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/blog-auditor.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/blog-auditor.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/aw-failure-investigator.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/avenger.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/auto-triage-issues.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/auto-triage-issues.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/audit-workflows.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/artifacts-summary.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/artifacts-summary.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/architecture-guardian.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/architecture-guardian.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/workflows/archie.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/approach-validator.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/api-consumption-report.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ai-moderator.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/agent-persona-explorer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/agent-performance-analyzer.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ace-editor.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ace-editor.lock.yml | Regenerated lock file reflecting updated prompt/env content. |
.github/workflows/ab-testing-advisor.md | Workflow frontmatter updated to max-daily-ai-credits. |
.github/workflows/ab-testing-advisor.lock.yml | Regenerated lock file with GH_AW_MAX_DAILY_AI_CREDITS env/gating updates. |
.github/aw/token-optimization.md | Updated internal guidance to use max-daily-ai-credits naming. |
.github/aw/syntax-agentic.md | Updated 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
resolveMaxDailyEffectiveTokenscurrently falls back to a hard-coded default of "500000" when neither frontmatter nor imports providemax-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
| 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). |
Uh oh!
There was an error while loading. Please reload this page.
Then summarize the remaining blockers.
|
This PR removes the unreleased
max-daily-effective-tokenspath end-to-end and standardizes daily guardrail configuration onmax-daily-ai-creditsonly. No compatibility fallback for the legacy field is retained.Frontmatter + schema
max-daily-effective-tokensfrom the main workflow schema and related shared limit defs.Compiler + parser
max-daily-ai-credits(no deprecated-field first-wins path).CLI enterprise defaults
default_max_daily_effective_tokenshandling fromgh aw envdefaults file parsing, validation, and bindings.GH_AW_DEFAULT_MAX_DAILY_EFFECTIVE_TOKENSpath).Workflow/runtime artifacts + docs
max-daily-ai-credits/default_max_daily_ai_credits.