Repository navigation
feat: add apiProxy.steering.budget as the switch for budget notices - #11478
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add apiProxy.steering.budget switch for budget notices
feat: add apiProxy.steering.budget as the switch for budget notices
Nov 11, 2026
lpcox
marked this pull request as ready for review
November 11, 2026 19:14
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the steering budget configuration change.
No open issues 🎉
What changed in this PR
Adds apiProxy.steering.budget as the primary switch for AWF’s AI-credit and time budget notices, while preserving legacy aliases and keeping notices off by default.
Changes:
- Adds the closed
steeringconfiguration object and validates conflicting alias values. - Introduces explicit enable/disable CLI flags with alias-aware config precedence.
- Adds regression coverage and updates schemas, help text, and documentation without changing the proxy’s runtime interface.
| File | Description |
|---|---|
src/parsers/rate-limit-parsers.ts |
Resolves steering options and detects CLI conflicts. |
src/parsers/rate-limit-parsers.test.ts |
Covers defaults, aliases, and conflicts. |
src/config-mapper.ts |
Maps both config names to steeringBudget. |
src/config-file.ts |
Adds steering types and alias conflict validation. |
src/config-file-validation.test.ts |
Covers steering values, unknown keys, and conflicts. |
src/config-file-mapping.test.ts |
Tests canonical steering option mapping. |
src/commands/preflight.ts |
Makes CLI precedence aware of aliases. |
src/commands/preflight.test.ts |
Tests legacy alias precedence recognition. |
src/commands/build-config.ts |
Resolves steering into the existing runtime setting. |
src/commands/build-config.test.ts |
Tests steering assembly and conflict rejection. |
src/cli-options.ts |
Registers enable/disable flags and legacy alias help. |
src/cli-options.test.ts |
Tests parsing of steering flags. |
src/awf-config-schema.json |
Updates the generated schema with steering settings. |
docs/awf-config.schema.json |
Defines steering settings and revised descriptions. |
docs/awf-config-spec.md |
Documents configuration, aliases, and precedence. |
docs/api-proxy-sidecar.md |
Updates budget-notice configuration guidance. |
docs-site/src/content/docs/reference/cli-reference.md |
Documents the new CLI flags and alias. |
Review effort: Max
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 4d39897 |
7 of 9 tasks
This was referenced Nov 11, 2026
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.
Budget notices (AI-credit and time) are switched on by
apiProxy.enableTokenSteering/--enable-token-steering, but "token" is the wrong name for what they cover. This PR addsapiProxy.steering.budgetas the main switch and keeps the old names as aliases. Notices stay off by default; turning them on by default is #11477.Config / schema
apiProxy.steeringto the schema: a closed object (additionalProperties: false) with a booleanbudgetkey.src/awf-config-schema.jsonis regenerated.validateAwfFileConfigrejectsenableTokenSteeringandsteering.budgetset to different values.steeringBudget.CLI
--steering-budgetand--no-steering-budget.--enable-token-steeringstays as an alias.resolveSteeringBudget(inparsers/rate-limit-parsers.ts) works out the final value assteeringBudget ?? enableTokenSteering ?? false.buildConfigexits with an error when--enable-token-steeringis combined with--no-steering-budget.applyConfigFilePrecedencenow has an alias table, so--enable-token-steeringon the CLI counts as settingsteeringBudget. A CLI flag under either name overrides the config file, so--enable-token-steeringplussteering.budget: falsein the file resolves to on rather than erroring.WrapperConfig.enableTokenSteeringand theAWF_ENABLE_TOKEN_STEERINGenv var are unchanged, socontainers/api-proxyneeds no changes.Docs
awf-config-spec.md: the option mapping list and §10.1.api-proxy-sidecar.md: the "Runtime and AI-credit steering" section.--helptext.maxAiCreditsandcontainer.agentTimeoutnow refer tosteering.budget.Review notes
schemas/token-usage.schema.jsonis deliberately left out of the diff:npm run generate:schemaalso reformats it, and I reverted that.apiProxy.steering.budgetas the switch for budget notices #11447