Raise SandboxError when the sandbox URL is unavailable - #59
Merged
sfroment merged 1 commit intoAug 27, 2026
Merged
Conversation
pedroCollogno
force-pushed
the
fix/sandbox-client-raises-on-missing-url
branch
from
August 27, 2026 10:07
9a63479 to
e1f5ada
Compare
_get_client / _get_async_client unpacked _get_sandbox_url() with no None-guard. For a gone sandbox the metadata/domain lookups swallow the NotFoundException and return None, so _get_sandbox_url() returns None and the unpack raised a raw `TypeError: cannot unpack non-iterable NoneType object` instead of the SandboxError the docstring promises. Guard the None case in both the sync and async client getters and raise SandboxError, so callers can detect a gone sandbox via the typed error.
pedroCollogno
force-pushed
the
fix/sandbox-client-raises-on-missing-url
branch
from
August 27, 2026 12:19
e1f5ada to
69099ac
Compare
pedroCollogno
commented
Aug 27, 2026
| def _get_conn_info(self) -> ConnectionInfo: | ||
| """ | ||
| Internal method to get the parameters needed to connect to the sandbox. | ||
| Caches the info after first retrieval. |
Contributor
Author
There was a problem hiding this comment.
removed, not accurate
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.
Issue
Sandbox._get_clientandAsyncSandbox._get_async_clientunpack_get_sandbox_url()with no None-guard.NotFoundExceptionand returnNoneTypeError: cannot unpack non-iterable NoneType objectinstead of theSandboxErrorthat_get_client's docstring already promises.sandbox.exec()path via_get_async_client(), so callers can't tell a gone sandbox from an unrelated bug.Fix
Guard the None case in both the sync and async client getters and raise
SandboxError, matching the documented contract, so callers can detect a gone sandbox via the typed error.koyeb/sandbox/test_sandbox_client.py: asserts both getters raiseSandboxError(notTypeError) when the URL is unavailable, plus happy-path cases confirming a resolvable URL still unpacks and buildsConnectionInfo.