Skip to content

Support exposed port resolution in Cloudflare sandbox#3525

Draft
ghostwriternr wants to merge 1 commit into
openai:mainfrom
ghostwriternr:naresh/cloudflare-exposed-port-names
Draft

Support exposed port resolution in Cloudflare sandbox#3525
ghostwriternr wants to merge 1 commit into
openai:mainfrom
ghostwriternr:naresh/cloudflare-exposed-port-names

Conversation

@ghostwriternr
Copy link
Copy Markdown
Contributor

@ghostwriternr ghostwriternr commented May 29, 2026

This adds exposed port resolution for the Cloudflare sandbox extension, allowing callers to obtain external HTTP endpoints for services running inside a sandbox.

The new exposed_port_names option maps sandbox ports to named endpoint prefixes. Ports listed only in exposed_port_names are treated as exposed ports automatically, so existing resolve_exposed_port validation still applies. When resolving a port, unnamed ports request ephemeral endpoints from the Cloudflare Sandbox Bridge, while named ports pass the configured prefix.

This requires a compatible Cloudflare Sandbox Bridge deployment that implements POST /v1/sandbox/:id/exposed-port/:port. The SDK resolves endpoint metadata through the bridge, but it does not start the application listening inside the sandbox; user code is still responsible for binding to the target port.

Resolve Cloudflare sandbox ports through the worker exposed-port
endpoint and parse the returned URL into the SDK endpoint shape. Keep
existing exposed_ports behavior intact while allowing callers to map
sandbox ports to named Cloudflare endpoint prefixes through
exposed_port_names.

Ports with names are also tracked as exposed ports so existing
resolution guards continue to apply, and provider or malformed
responses surface as exposed-port errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants