Repository navigation
fix: transport error normalization, sandbox URL encoding & hydration, and session/export parity - #152
Merged
Merged
Conversation
…rets hydration, and session/export parity
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 46ba9b2. Configure here.
…elds - Keep enable_webgl_fingerprinting for compatibility but document it as discontinued: the server ignores it. - Remove max_concurrent_sessions / total_active_sessions_count from GetActiveSessionsCountResponse: /sessions/active-count only returns activeSessionsCount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AHarmlessPyro
approved these changes
Nov 10, 2026
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.

Summary
This PR resolves several SDK audit issues and aligns
python-sdkbehavior withnode-sdk:SyncTransport&AsyncTransporterror normalization andtimeout:put()anddelete()inTransportStrategy,SyncTransport, andAsyncTransportto accepttimeout: Optional[float] = None(matchingpost()andget()) and passtimeout=timeouttoself.client.put/self.client.deletewhen provided.put()anddelete()throughnormalize_network_error(e, "control", "Request failed", request_context("PUT"|"DELETE", url))(re-raisingKeyboardInterrupt,SystemExit, andasyncio.CancelledError).httpx.RequestErrorin_handle_responsevianormalize_network_error(e, "control", "Request failed", request_context(response.request.method, str(response.request.url)))to preserveretryable,service,cause, andrequest_context.SandboxHandle._hydratepreservingstartup_secrets:self._detail.startup_secretsonSandboxHandle._hydrate(detail)when a refreshedSandboxDetailresponse omitsstartup_secrets(None), sosandbox.info()/sandbox.refresh()does not wipestartup_secrets._apply_runtime_sessionhelper.URL-encode path parameters in
SandboxManager/SandboxHandle:urllib.parse.quote(str(...), safe="")when interpolatingimage,snapshot,build_id, andsandbox_idinto URL paths in both sync and asyncSandboxManager.Missing exports & Session parity:
HyperbrowserErrorand image build utilities (docker_build_context_fingerprint,DockerBuildContextChangedError,image_build_name,docker_image_digest,DockerCommandError) fromhyperbrowserandhyperbrowser.image_builds."WebBotAuthParams"and"ProxyRoute"to__all__inhyperbrowser.types.session.FILL_CREDENTIAL_TOOL_OPENAI,FILL_CREDENTIAL_TOOL_ANTHROPIC,FILL_CREDENTIAL_TOOL_GEMINI,FILL_CREDENTIAL_DESCRIPTION, andFILL_CREDENTIAL_SCHEMAinhyperbrowser.tools.enable_webgl_fingerprinting: Optional[bool](serialization_alias="enableWebglFingerprinting") toCreateSessionParamsin bothhyperbrowser.models.sessionandhyperbrowser.types.session.CaptchaSolverTypetoUnion[Literal["visual"], str]so future backend solver types do not fail Pydantic validation.get_active_sessions_count()(GET /sessions/active-count) returningGetActiveSessionsCountResponseto sync and asyncSessionManager.BrowserUseTool.runnableandBrowserUseTool.async_runnableto fall back toresp.error or ""whenresp.dataorfinal_resultis absent, and validated thatsession_idis non-empty inSessionCredentialsManager.fill.Testing
tests/test_sdk_audit_fixes.pycovering all changes.ruff check .,ruff format --check, andpytest tests --ignore=tests/sandbox/e2e(1065 passed).Note
Medium Risk
Changes affect core transport error handling and many sandbox control URLs, but behavior is largely corrective and aligned with existing patterns; risk is moderate rather than high because auth/data paths are mostly validation and encoding fixes.
Overview
This 1.15.1 patch tightens HTTP client behavior, sandbox handling, and public API parity with the Node SDK.
Transport:
putanddeletenow accept optionaltimeoutand route failures throughnormalize_network_error(with request context), including in_handle_responseforhttpx.RequestError.asyncio.CancelledErroris no longer wrapped as a network error.Sandboxes: Path parameters (
sandbox_id, image/snapshot/build IDs) are URL-encoded._hydratekeeps existingstartup_secretswhen refreshed detail omits them; unused_apply_runtime_sessionis removed.Sessions & models: Adds
get_active_sessions_count()andGetActiveSessionsCountResponse; widensCaptchaSolverType; re-adds deprecatedenable_webgl_fingerprintingfor backward compatibility. Credentialfillrejects empty session IDs client-side.Exports & tooling: Top-level /
image_buildsexpose Docker helpers andHyperbrowserError;DockerCommandErrorfor missing Docker CLI; more fill-credential tool symbols intools.__all__.BrowserUseToolreturnsresp.errorwhen there is nofinal_result.Tests in
test_sdk_audit_fixes.pycover these behaviors.Reviewed by Cursor Bugbot for commit 1aa5fed. Bugbot is set up for automated code reviews on this repo. Configure here.