Accept 100M/100K token notation for templatable token-limit fields#36928
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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
Support K/M suffix token limits for templatable token fields
Accept Jun 4, 2026
100M/100K token notation for templatable token-limit fields
Copilot created this pull request from a session on behalf of
pelikhan
June 4, 2026 15:06
View session
pelikhan
reviewed
Jun 4, 2026
| }, | ||
| "max-daily-effective-tokens": { | ||
| "$ref": "#/$defs/templatable_integer", | ||
| "$ref": "#/$defs/max_daily_effective_tokens_limit", |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the main workflow frontmatter schema so max-effective-tokens and max-daily-effective-tokens accept the same token-limit notation already supported elsewhere (e.g., 100K/100M, case-insensitive) while preserving GitHub Actions expression support.
Changes:
- Rewired top-level schema properties to reference token-limit-specific
$defsinstead oftemplatable_integer. - Refactored/expanded
$defsfor effective-token limits to clearly separate “positive limit” vs “disabled via negative / -1”. - Updated parser schema validation tests to expect suffix strings and
-1sentinel values to pass, and0to fail.
Show a summary per file
| File | Description |
|---|---|
pkg/parser/schemas/main_workflow_schema.json |
Repoints max-effective-tokens / max-daily-effective-tokens to token-limit defs and introduces a shared “positive effective tokens limit” helper to allow K/M suffix + expressions. |
pkg/parser/schema_test.go |
Updates schema validation tests for 0, -1, and K/M-suffixed string acceptance (including lowercase support). |
.github/skills/agentic-workflows/SKILL.md |
Adds additional referenced docs to the skill’s “load these files” list. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
Comment on lines
+556
to
+560
| validFrontmatter := map[string]any{ | ||
| "on": "push", | ||
| "max-effective-tokens": "100k", | ||
| "max-daily-effective-tokens": "100M", | ||
| } |
| } | ||
|
|
||
| func TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_MaxDailyEffectiveTokensNegativeInvalid(t *testing.T) { | ||
| func TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_MaxDailyEffectiveTokensNegativeAllowed(t *testing.T) { |
| t.Fatal("expected negative max-daily-effective-tokens to fail schema validation") | ||
| err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(validFrontmatter, "/tmp/gh-aw/max-daily-effective-tokens-negative-test.md") | ||
| if err != nil { | ||
| t.Fatalf("expected negative max-daily-effective-tokens to pass schema validation, got: %v", err) |
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.
max-effective-tokensandmax-daily-effective-tokenswere still validated as generictemplatable_integer, so values like100M/100Kfailed schema validation (as seen in the compile failure). This change aligns those fields with the token-limit schema that already supports K/M suffix notation, including lowercase variants.Schema alignment
max-effective-tokens→#/$defs/max_effective_tokens_limitmax-daily-effective-tokens→#/$defs/max_daily_effective_tokens_limitK/M, case-insensitive) and preserves expression support.Parser schema tests
100M,100k,100K,100mpatterns).0invalid;-1sentinel behavior where defined).Example