Skip to content

fix(loop): preserve unavailable request-budget compatibility - #55

Merged
Brian Krabach (bkrabach) merged 2 commits into
mainfrom
fix/initial-unavailable-request-budget
Sep 15, 2026
Merged

Brian Krabach (bkrabach) merged 2 commits into
mainfrom
fix/initial-unavailable-request-budget

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

What changed

  • Handle an initial request_budget result of None as unavailable, preserving the established normal-dispatch path.
  • Once a concrete budget has required a context rebuild or output-reserve probe, fail locally if the budget capability disappears or returns None; do not treat uncertainty as a fit or send an unchecked SDK request.
  • Add consumer coverage for cold and calibrated/warm behavior, including completed fake-SDK calibration before the existing warm-compaction protections.

Why

A provider can lack a trustworthy cold budget before it has calibration data. This consumer must keep that compatibility case distinct from a later loss of a capability already used to enforce a concrete budget. The latter remains fail-closed, without dropping input.

Compatibility

  • Providers without request_budget, and an initial unavailable budget, keep normal dispatch behavior.
  • A later unavailable result during an active budget-enforcement sequence now raises locally before SDK dispatch.
  • No input is silently omitted; this change adds no configuration or public API surface.

Verification

  • Loop non-live suite: 320 passed; 1 optional cross-module collection skipped in the SDK-less environment.
  • Companion provider non-live suite: 984 passed; 2 deselected.
  • Cross-module fake-SDK checks: 2 existing checks and 3 new mechanism cases passed, covering cold uncertainty, calibration, low output-cap probing, one-shot warning behavior, and warm-history protection.
  • Source review passed; no paid model calls were made.

Breaking changes

None. The only changed failure behavior is intentional: a budget capability that becomes unavailable after returning a concrete decision fails closed before dispatch.

Generated with Amplifier

Initial literal None from optional request_budget preserves the ordinary dispatch path. Later None or a vanished callable after a concrete rebuild/output decision raises ContextLengthError locally. Adds forced-finalization regressions that prove no final SDK dispatch and tool-turn closure.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach
Brian Krabach (bkrabach) merged commit c458634 into main Sep 15, 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