Bound Gemini curation requests with a timeout and log progress - #6
Merged
Conversation
Fixes #5. genai.Client() was constructed with no http_options, so the SDK's default timeout behavior applied -- its own retry loop (tenacity, on 408/429/5xx) logs nothing, and an unset timeout can mean an unbounded wait on a stalled connection. A real run appeared to hang indefinitely with zero output during curation as a result. Pass an explicit 60s http_options timeout to bound each attempt, and log immediately before/after the request so a multi-minute wait during retries is visible and distinguishable from an actual hang. Also documents this in the README's curation section. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Fixes #5.
Summary
--curation-backend geminidirectly in a live terminal (ruling out output buffering).genai.Client()was constructed with nohttp_options, so the request had no explicit timeout, and the SDK's own retry loop (tenacity, on 408/429/5xx) doesn't log anything -- a stall here was indistinguishable from a genuine hang.http_options=types.HttpOptions(timeout=60_000)(60s) to bound each request attempt, and log immediately before/after the call so a multi-minute wait during retries is visible instead of silent.Test plan
pytest-- 114 passed (new test verifies both the explicithttp_options.timeoutand the before/after log lines, via a mockedgenai.Client)