Skip to content

fix(sandboxes): retry upload response read errors - #903

Open
xeophon wants to merge 1 commit into
mainfrom
fix/sdk-upload-readerror
Open

fix(sandboxes): retry upload response read errors#903
xeophon wants to merge 1 commit into
mainfrom
fix/sdk-upload-readerror

Conversation

@xeophon

@xeophon xeophon commented Sep 6, 2026

Copy link
Copy Markdown
Member

File uploads now recover from transient response-read failures instead of immediately aborting sandbox setup. Both synchronous and asynchronous file and bytes uploads retry httpx.ReadError using the existing four-attempt upload budget and exponential backoff.

Retries resend the same bytes to the same destination and share the budget with existing transient HTTP retries. The generic POST retry policy remains unchanged. If a bytes upload ultimately fails, its error includes the exception type and preserves the original cause.


Note

Low Risk
Idempotent upload retries only; behavior change is limited to recovering transient network/read failures without altering auth, 409, or generic POST retry policies.

Overview
Sandbox uploads now treat transient httpx.ReadError (failures while reading the gateway response) like existing 408/5xx retries, instead of failing immediately.

Sync and async upload_file and upload_bytes route ReadError through _should_retry_upload_error, which shares the same MAX_409_RETRIES attempt counter and exponential backoff as other transient upload errors. upload_bytes also surfaces failures with the exception type and chains the original cause when retries are exhausted.

New parametrized tests cover sync/async clients, file vs bytes uploads, and exhaustion after the retry budget.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T15:11:21.611231Z bf14b90 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant