Repository navigation
Conversation
Signed-off-by: Frederic Lafrance <[email protected]>
lafrancef
marked this pull request as draft
October 8, 2026 15:22
6 tasks
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.
Add a standalone per-session proxy that caps policy model POST attempts and returns a typed terminal budget stop, giving adapters a shared runtime for turn-constrained rollouts.
Use
TurnConstraintSessionto bind the policy client tosession.base_url, then persistsession.metadataafter exit. The usage guide covers configuration, routing, partial-result verification and receipt persistence.session_budget_exhaustedfor subsequent attempts. Retries and auxiliary calls through the endpoint consume budget; a natural finish on request N is not exhaustion.Existing harness behavior stays unchanged until an adapter explicitly binds this primitive. Adapter integrations must preserve partial outputs for normal verification and keep infrastructure failures distinct from intentional budget stops.
Rollout evidence: N/A for this standalone library change; no agent or verifier is wired to the proxy by this PR. Local HTTP fixtures exercise both streaming APIs, concurrent admission, independent sessions, retry accounting, capture routing and teardown. Harness-level model qualification belongs with each subsequent binding.
No separate issue is needed for this self-contained runtime addition.