Skip to content

Retry transient GET requests - #119

Merged
Dingway98 merged 1 commit into
mainfrom
codex/python-sdk-get-retries
Aug 28, 2026
Merged

Retry transient GET requests#119
Dingway98 merged 1 commit into
mainfrom
codex/python-sdk-get-retries

Conversation

@Dingway98

@Dingway98 Dingway98 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

Validation

  • ruff check
  • pytest

Note

Medium Risk
Touches shared HTTP/error paths for all control and sandbox API calls; GET-only retries limit duplicate-write risk, but behavior on failures and cancellations changes client-wide.

Overview
Adds automatic retries for idempotent GETs on the control API (sync/async Transport.get and sandbox manager _request), up to 3 attempts with jittered exponential backoff when the failure is marked retryable (transient HTTP statuses like 429/502/503/504 or httpx network/timeouts). POST and other mutating calls are not retried.

Error handling is tightened in sandbox_common: request_context tags failures like [GET /sandbox] (paths only, no query secrets), empty httpx errors include the exception type, and cancellation/interrupt/control-flow errors are re-raised instead of being wrapped as network errors. Runtime sandbox transport paths now pass that context into normalized errors.

Control transport responses also set retryable, service, and request_id on more HyperbrowserError cases so retry logic and debugging stay consistent. New pytest coverage exercises GET retry/stop conditions, POST no-retry, and normalization behavior.

Reviewed by Cursor Bugbot for commit a660c1c. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a660c1c. Configure here.

Comment thread hyperbrowser/sandbox_common.py
@Dingway98
Dingway98 added this pull request to the merge queue Aug 28, 2026
@Dingway98
Dingway98 removed this pull request from the merge queue due to a manual request Aug 28, 2026
@Dingway98
Dingway98 merged commit 6718e76 into main Aug 28, 2026
13 checks passed
@Dingway98
Dingway98 deleted the codex/python-sdk-get-retries branch August 28, 2026 18:59
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