sdks/sandbox/go/v1.0.1

opensandbox-group/OpenSandboxsdks/sandbox/go/v1.0.1May 18, 2026by Pangjiping

AI Summary

This SDK release introduces breaking changes to the Close interface and enforces TLS 1.2 security standards. It adds multi-file upload capabilities and improves header forwarding to ensure routing works correctly in complex deployments.

Key Highlights

  • Breaking change: `Sandbox.Close` now returns `error` to satisfy `io.Closer`.
  • Breaking change: Enforces TLS 1.2 minimum for HTTP clients.
  • Added multi-file upload support via new `UploadFiles` helper.
  • Added User-Agent header to all outgoing requests.
  • Fixed header forwarding to ensure execd/egress requests reach correct routing endpoints.

Breaking Changes

  • Sandbox.Close / SandboxManager.Close now return error
  • TLS 1.2 minimum enforced for SDK HTTP clients

New Features

  • Multi-file upload support
  • User-Agent header on outgoing requests

Full Release Notes

## What's New

### ⚠️ Breaking Changes

- **`Sandbox.Close` / `SandboxManager.Close` now return `error`** to satisfy `io.Closer`. Callers that previously ignored the return value need to update signatures (and ideally check the returned error). Same PR also drains HTTP response bodies after read so the underlying connection is reused, replaces manual `url.QueryEscape` with `url.Values`, drops the deprecated `crypto/dsa` import + DSA public-key branch, and trims unused `go.mod` dependencies. ([#851](https://github.com/alibaba/OpenSandbox/pull/851))
- **TLS 1.2 minimum** for SDK-created HTTP clients, enforcing the NIST 2030 minimum certificate key/hash length policy. Environments still serving TLS 1.0/1.1 endpoints must upgrade before adopting this release. Compatibility escape hatches are exposed for legacy weaker certificates. (#790)

### ✨ Features

- **Multi-file upload**: new `UploadFiles` helper on `Sandbox` performs multipart uploads against execd's existing `/files/upload` multi-file contract. The single-file `UploadFile` is now a thin wrapper over the batch path. `/files/download` remains single-file streaming, so no `DownloadFiles` counterpart is added. ([#843](https://github.com/alibaba/OpenSandbox/pull/843))
- **User-Agent header** (`OpenSandbox-Go-SDK/1.0.1`) is now set on every outgoing request — `doRequestOnce`, `doStreamRequest`, `GetCommandLogs`, `UploadFiles`, `DownloadFile`. (#850)

### 🐛 Bug Fixes

- **Forward all `GetEndpoint` headers** on subsequent execd/egress requests, matching the Python SDK. The previous code only forwarded `X-EXECD-ACCESS-TOKEN` / `OPENSANDBOX-EGRESS-AUTH` and dropped everything else, breaking routing whenever the server added new headers (sticky-session keys, routing hints, etc.). Closes #886. (#900)
- **Empty SSE stream now surfaces an error** instead of silently returning a "successful but empty" `Execution` (`stdout=[]`, `stderr=[]`, `results=[]`, `error=nil`, `complete=nil`). `streamSSE()` now counts dispatched events and returns `opensandbox: empty sse stream` when the body closes with zero events, so transport/proxy/execd failures stop masquerading as successful executions. (#778)

## 👥 Contributors

Thanks to these contributors ❤️

- @Pangjiping
- @zpzjzj
- @hittyt
- @skyler0513

---
```bash
go get github.com/alibaba/OpenSandbox/sdks/sandbox/go@v1.0.1
```