Skip to content

fix(loop): await optional provider request budgets - #57

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/awaitable-request-budget
Sep 16, 2026
Merged

Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/awaitable-request-budget

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

Summary

  • Await an optional provider request_budget result when it is awaitable, while retaining legacy synchronous provider behavior.
  • Preserve request_options introspection 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

  • 49 focused tests passed.
  • Full test suite: 343 passed; 1 optional cross-provider import was skipped.
  • Deterministic fake-provider coverage exercises normal count/send, oversized hard-fit/recount/send, and a later-unavailable budget result with no send.

Compatibility

Legacy synchronous providers retain their existing behavior; named request_options introspection 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.

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>
@bkrabach
Brian Krabach (bkrabach) merged commit 6a3e78a into main Sep 16, 2026
5 checks passed
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.

2 participants