Repository navigation
Prepare 2.0: bounded retries, pooled clients and reliable diagnostics - #3
Merged
Merged
Conversation
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.
Evaluations could sleep for unbounded Retry-After values, opened a new HTTP connection pool on every call, and exposed too little error metadata for callers to recover. The public entropy helper also accepted invalid distributions as full confidence.
This PR adds a configurable 35-second evaluation budget, rejects retry waits that cannot fit, cancels async HTTP I/O at the deadline, and reuses sync/async clients with explicit lifecycle methods and context managers. Provider errors now include status, retryability, attempts, Retry-After and request ID without response bodies. Entropy inputs are validated and softmax retains full precision.
Synchronous deadlines are cooperative: the remaining budget limits HTTP phases and overdue results are rejected, but in-flight sync I/O cannot be interrupted at an exact wall-clock deadline. This limitation is documented. Async clients must be closed in their original event loop.
Prepare version 2.0.0 across package and plugin manifests, document migration and changelog, and add seven synthetic labeled triage fixtures plus a protocol for independent held-out evaluation. Fixtures are not real customer evidence. No release is published and no accuracy or latency improvement is claimed.
Validation: 244 tests passed; source distribution and wheel built; wheel installed in an isolated environment and CLI smoke checks passed; git diff --check passed. No live model calls were made. Repository About metadata is outside these code changes.