Skip to content

fix: fit measured output reserves - #44

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/measured-output-cap-fitting
Sep 20, 2026
Merged

Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/measured-output-cap-fitting

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

What changed

Add an optional fit_output(view, attempt) callback to the measured request-view path. After the existing eight legal reduction rungs still leave a native-measured request above its hard allowance, the request owner may return a newly counted output-reserve candidate. Context validates the exact counted envelope, reports reduced_output, and preserves staged commit/rollback behavior.

Why

Some provider budgets fit when the output reserve is reduced, without dropping required input. This provides that bounded negotiation while retaining existing protection and compatibility behavior.

Verification

  • 219 tests passed, 1 existing xfail
  • Ruff 0.14.10 check passed
  • DTU validation: 208 passed, 11 abstract Core contract skips, 1 existing xfail
  • Four-way old/new interoperability and rollback/protection behavior validated offline

Breaking changes

None. The callback is optional; callers without it retain the existing behavior. No defaults, core types, or required/tool protection rules changed.

The companion Loop change will be published separately after this dependency lands.

Generated with Amplifier

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