Repository navigation
feat(sdk): retry control-plane requests on Should-Retry, falling back to 429/502/503/504 - #1998
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
🦋 Changeset detectedLatest commit: 310b2b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Package ArtifactsBuilt from f763e68. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-dockerfile-utils-0.1.2-devin-1792434077-should-retry-header.0.tgz ./e2b-2.59.1-devin-1792434077-should-retry-header.0.tgzCLI ( npm install ./e2b-cli-2.22.4-devin-1792434077-should-retry-header.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.9.1-devin-1792434077-should-retry-header.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.5.1-devin-1792434077-should-retry-header.0.tgzPython SDK ( pip install ./e2b_dockerfile_utils-0.1.1+devin.1792434077.should.retry.header-py3-none-any.whl ./e2b-2.59.0+devin.1792434077.should.retry.header-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.11.3+devin.1792434077.should.retry.header-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.7.2+devin.1792434077.should.retry.header-py3-none-any.whl |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
e0a0110 to
1bcf58b
Compare
|
check all the issues above |
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
… absent Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
1bcf58b to
310b2b7
Compare
|
🚀 |
Summary
The SDK now lets the server decide whether a control-plane API response can be retried, through the
Should-Retryresponse header (added in e2b-dev/belt#4687). It still has a status-code fallback for responses that don't carry the header, such as errors from a load balancer in front of the E2B proxy. JSwithRetryand PythonRetryableTransport/AsyncRetryableTransportbehave the same way.REPLAYABLE_METHODS,REPLAYABLE_OPERATIONS,isReplayable/is_replayableand PythonNETWORK_ERRORS. No method or path checks are left.RETRYABLE_STATUSESis now{429, 502, 503, 504}and applies only when the header is absent.ECONNRESET, the browser's opaqueTypeError, and httpxReadError/RemoteProtocolError. Without the allowlists the SDK can't tell whether a replay is safe.isRetryableFetchError(error)now meansisConnectionError(error). In Python,ConnectionRetryTransporthandles them.retriescount, the request-timeout budget, single-attempt streaming bodies, and the undici connector retries.Behavior changes:
Retry-Afterand a 504 are now retried with backoff.POST /v2/sandboxes) is now retried too, so a load-balancer 502/504 that arrives after the backend already created the sandbox can leave a duplicate.Should-Retry: falsestops retries for any status.Usage
No API change.
retriesstill controls how many times the SDK retries:Linear: SDK-395
Link to Devin session: https://app.devin.ai/sessions/47966a4990af4fc19daa97413e9ad2ab
Open in Devin Desktop: https://app.devin.ai/desktop/session/47966a4990af4fc19daa97413e9ad2ab?variant=devin
Requested by: @mishushakov