fix(loop): await optional provider request budgets - #57
Merged
Merged
Conversation
Await optional awaitable request_budget decisions while retaining synchronous compatibility and fail-closed rebuild behavior. Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.
Summary
request_budgetresult when it is awaitable, while retaining legacy synchronous provider behavior.request_optionsintrospection and add async regression coverage for hard-fit/recount and later-unavailable budget paths.Why
Async budget providers need their decision resolved before the Loop chooses whether to count, send, or retain a hard fit.
Verification
Compatibility
Legacy synchronous providers retain their existing behavior; named
request_optionsintrospection is unchanged.Scope
Existing source, README, and tests only; no new public content class.
Contract direction
Toward: resolves compatibility for optional async request budgets without adding counters, vendors, Core protocols, or limits.
Observations
None arose.
Limits of verification
Not verified: live-vendor count calls, performance, native-token behavior, or session stability.
Breaking changes
None.