Sdk improvements#50
Merged
Merged
Conversation
bchatelard
commented
Jun 30, 2026
Member
- SandboxServiceError — New typed exception for HTTP 5xx errors from the sandbox executor, with status_code attribute. Raised from executor_client.py instead of leaking raw httpx.HTTPStatusError.
- SandboxTimeoutError — httpx.TimeoutException (including ReadTimeout) is now converted to SandboxTimeoutError in both buffered and streaming requests.
- exec.py simplified — Removed the broad except Exception blocks that were silently wrapping errors into CommandResult. Errors now propagate as typed exceptions instead of masquerading as failed commands.
- filesystem.py cleanup — Fixed isinstance() anti-pattern in exception handling; SandboxServiceError and SandboxFilesystemError are now caught with proper except clauses.
- executor_client.py streaming fix — Fixed ResponseNotRead crash when accessing response.text on streaming responses (need response.read() / await response.aread() first).
- close() / del fix — Used getattr(self, "_closed", True) to prevent AttributeError when init fails partway through (sync + async clients).
It will catch unexpected errors from the sandbox executor
Fix the error: AttributeError: 'SandboxClient' object has no attribute '_closed'
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.