Repository navigation
Support case-insensitive K/M suffixes for AI credit budgets - #11533
Merged
Merged
Conversation
Co-authored-by: lpcox <[email protected]>
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
lpcox
marked this pull request as ready for review
November 13, 2026 14:46
Contributor
There was a problem hiding this comment.
🟢 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/0disabled-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)
Contributor
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Contributor
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 3093572 |
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.
AI credit budgets now accept compact whole-number values such as
20Kand100Macross CLI and AWF config inputs. Values are normalized before enforcement; existing numeric budgets and-1/0disabled-budget semantics remain unchanged.K(×1,000) andM(×1,000,000) suffixes. Rejects malformed, non-positive, and unsafe overflow values.