Add retry to exec() - #220
Conversation
SandboxProcess.exec() calls client.post() directly without the retry_on_transient_reset_async wrapper that protects other sandbox methods (get, list, logs). This allows httpx ReadError from stale connections to propagate unhandled to callers. Wrap the non-streaming exec path in retry_on_transient_reset_async, matching the pattern used by other methods in the same file.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5ee526d. Configure here.
POST /process is a non-idempotent create operation. Retrying after a transport drop could spawn duplicate processes while callers only see the later pid. Revert to the original non-retried path, consistent with the test_process_exec_is_not_retried_on_transport_reset assertion and the retry helper's documented scope (idempotent reads only).
|
Thanks for the catch — you're right that I've reverted the retry wrapper in dded5d3, restoring the original non-retried path. This is consistent with:
The original insight about stale connection errors propagating from |

Summary
SandboxProcess.exec()POST call withretry_on_transient_reset_async, matching the pattern used byget(),list(), andlogs()in the same filehttpx.ReadErrorfrom stale connections propagating unhandled to callersContext
Insight: https://app.mendral.com/insights/01M07AAN6MCM0S1MWHKDGTH1XZ
exec()was the only sandbox method missing the transient retry wrapper, causing unhandledReadErrorexceptions when the httpx client held a stale TCP connection.Note
Created by Mendral. Tag @mendral-app with feedback or questions.
Note
Low Risk
Small, localized resilience change aligned with existing sandbox HTTP patterns; no auth or data-model changes.
Overview
SandboxProcess.exec()now wraps itsPOST /processHTTP call withretry_on_transient_reset_async, matchingget(),list(), andlogs()in the same module.That closes a gap where stale pooled connections could raise unhandled
httpx.ReadError(and related transient failures) on exec while other process APIs already retried and reset the client.Reviewed by Cursor Bugbot for commit dded5d3. Bugbot is set up for automated code reviews on this repo. Configure here.