Repository navigation
Poll cached full scan results until ready - #115
Open
John-David Dalton (jdalton) wants to merge 2 commits into
Open
John-David Dalton (jdalton) wants to merge 2 commits into
John-David Dalton (jdalton) wants to merge 2 commits into
Conversation
Wait for cached full scan artifacts and bound retries so SDK callers receive completed results or a clear timeout. Assisted-by: Codex: GPT-6
Exercise the cached stream through the real SDK transport and bump the package version to an unpublished release. Assisted-by: Codex: GPT-6
This branch has not been deployed
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.
LLM Description written by Codex:gpt-6-astra
Keep full-scan reads working while analysis is still processing. Existing callers now use cached results with bounded polling instead of holding one long request.
Root Cause
fullscans.stream()made one uncached request and treated202 Processingas a failed result.Fix
Validation
29 tests pass against a local HTTP fixture using the real SDK and requests transport. Ruff and diff checks pass. Tests cover processing, timeout, transient and permanent failures, encoded identifiers, invalid settings, and artifact parsing.
No SDK release or CLI dependency update is included.
Public Changelog
Full-scan reads wait for cached analysis results within the configured timeout.
Note
Medium Risk
Changes default full-scan read behavior (cached polling, longer wall time, new timeout errors) for all
stream()callers; logic is well-tested but affects a core API path.Overview
fullscans.stream()no longer treats a single202 Processingas failure. It requests?cached=true, polls with exponential backoff (defaults 5–10s) until results are ready or the budget expires, and raisesAPITimeoutwhen the poll window runs out.Polling honors optional
poll_timeout_seconds(default: SDK request timeout), validates timeout/interval values up front, URL-encodes org and scan IDs, retries transientAPIFailures and202responses, and still fails fast on auth/not-found errors. HTTP responses are closed after use.API.do_requestgains an optional per-callrequest_timeoutoverride so each poll uses a bounded timeout (min(30s, configured timeout, remaining poll budget)).New localhost HTTP fixture and unit tests cover ready/processing/empty streams, retries, timeouts, encoded IDs, and invalid settings.
Reviewed by Cursor Bugbot for commit 97d148a. Configure here.