Skip to content

Support case-insensitive K/M suffixes for AI credit budgets - #11533

Merged
lpcox merged 2 commits into
mainfrom
copilot/support-case-insensitive-k-m-suffixes
Nov 13, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/support-case-insensitive-k-m-suffixes

Conversation

Copilot AI commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI credit budgets now accept compact whole-number values such as 20K and 100M across CLI and AWF config inputs. Values are normalized before enforcement; existing numeric budgets and -1/0 disabled-budget semantics remain unchanged.

  • Parsing and validation: Supports case-insensitive K (×1,000) and M (×1,000,000) suffixes. Rejects malformed, non-positive, and unsafe overflow values.
  • Configuration: Normalizes suffixes from JSON/YAML files and stdin. Updates the config schema and specification.
awf --max-ai-credits 20k -- <command>
apiProxy:
  maxAiCredits: 100M

Copilot AI changed the title [WIP] Support case-insensitive K/M suffixes for max-ai-credits Support case-insensitive K/M suffixes for AI credit budgets Nov 13, 2026
Copilot AI requested a review from lpcox November 13, 2026 14:44
@lpcox
lpcox marked this pull request as ready for review November 13, 2026 14:46
Copilot AI adaptive review requested due to automatic review settings November 13, 2026 14:46

Copilot AI 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.

🟢 Approval recommended

No active review issues were identified for the AI credit budget suffix support change.

No open issues 🎉

What changed in this PR

Adds native case-insensitive K/M suffix support for AI credit budgets, allowing downstream workflow compilers to pass compact values directly to AWF.

Changes:

  • Normalizes suffixed budgets from CLI, JSON/YAML files, and stdin while preserving numeric budgets and -1/0 disabled-budget semantics.
  • Rejects malformed, non-positive, and unsafe suffixed values before enforcement.
  • Updates schemas, documentation, CLI help, and regression coverage.
File Description
src/​schema.test.ts Tests schema acceptance and rejection of suffix strings.
src/​config-file.ts Validates and normalizes suffixed configuration budgets.
src/​config-file-validation.test.ts Covers valid and invalid configuration suffixes.
src/​config-file-loading.test.ts Covers normalization from files and stdin, including overflow errors.
src/​commands/​validators/​log-and-limits.ts Integrates suffix parsing into CLI budget validation.
src/​commands/​validators/​log-and-limits.test.ts Tests CLI normalization and invalid-budget rejection.
src/​cli-options.ts Documents suffix support in CLI help.
src/​cli-options.test.ts Covers compact budget arguments.
src/​awf-config-schema.json Allows suffix strings in the runtime schema.
src/​ai-credits.ts Adds shared suffix parsing and safe-integer checks.
docs/​awf-config.schema.json Allows suffix strings in the published schema.
docs/​awf-config-spec.md Documents suffix syntax, normalization, and limits.

Review effort: Balanced (dynamic)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11533 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 3093572

@lpcox
lpcox merged commit 0592ead into main Nov 13, 2026
47 of 52 checks passed
@lpcox
lpcox deleted the copilot/support-case-insensitive-k-m-suffixes branch November 13, 2026 15:29
Sign up for free to 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.

Support case-insensitive K/M suffixes for max-ai-credits

3 participants