Skip to content

Reuse one HTTP client for OpenSandbox calls - #939

Merged
SaladDay merged 1 commit into
mainfrom
codex/opensandbox-shared-http-client
Nov 7, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/opensandbox-shared-http-client

Conversation

@SaladDay

@SaladDay SaladDay commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The OpenSandbox SDK builds a new http.Transport for the lifecycle client and another for the execd client on every ConnectSandbox. That means every Observe, Create and RunCommand opens new TCP connections, and the idle ones stay in the discarded transports for 30 s. The adapter now builds one client and passes it to both the ConnectionConfig and the lifecycle client, so every call to the server shares one transport. Timeouts are unchanged: the SDK still applies its 30-second request timeout to its own copy of the client.

Measurement

Fifty Observe + RunCommand pairs against the package's fake OpenSandbox server, three runs each, all identical:

Before After
New TCP connections 201 51
Goroutines left alive afterwards 455 5
Wall time (loopback) 285–295 ms 129–133 ms

The measurement test was temporary and is not committed.

Verification

  • make check-sandbox-provider-contract passes.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay merged commit 38ec995 into main Nov 7, 2026
19 checks passed
@SaladDay
SaladDay deleted the codex/opensandbox-shared-http-client branch November 7, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant