Tencent/WeKnora · error

unsupported remote sandbox provider %q

Error message

unsupported remote sandbox provider %q

What it means

newRemoteSessionLifecycle validates that the supplied RemoteSandboxClient's Provider is one of the supported remote sandbox providers. If the provider name is not recognized by isRemoteProvider, construction fails with this error before any lifecycle object is created. The library throws it to prevent running the session-bound sandbox lifecycle against a client type it cannot coordinate (e.g. a local or unknown provider).

Source

Thrown at internal/sandbox/session_lifecycle.go:67

func newRemoteSessionLifecycle(
	client RemoteSandboxClient,
	bindings SessionSandboxBindingStore,
	sessionChecker SessionExistenceChecker,
	createRequest RemoteCreateRequest,
	cleanupTimeout time.Duration,
	sandboxConfigID string,
) (*remoteSessionLifecycle, error) {
	if client == nil {
		return nil, errors.New("remote sandbox client is required")
	}
	if bindings == nil {
		return nil, errors.New("session sandbox binding store is required")
	}
	if sessionChecker == nil {
		return nil, errors.New("session existence checker is required")
	}
	if !isRemoteProvider(client.Provider()) {
		return nil, fmt.Errorf("unsupported remote sandbox provider %q", client.Provider())
	}
	if !client.Capabilities().SupportsReconnect {
		return nil, fmt.Errorf("remote sandbox provider %q does not support reconnect", client.Provider())
	}
	if strings.TrimSpace(createRequest.TemplateID) == "" {
		return nil, errors.New("remote sandbox template ID is required")
	}
	if cleanupTimeout <= 0 {
		return nil, errors.New("remote sandbox cleanup timeout must be positive")
	}
	if strings.TrimSpace(sandboxConfigID) == "" {
		sandboxConfigID = types.SandboxConfigIDGlobalDefault
	}
	createRequest.Metadata = cloneMetadata(createRequest.Metadata)
	createRequest.EnvVars = cloneMetadata(createRequest.EnvVars)
	return &remoteSessionLifecycle{
		client:          client,
		bindings:        bindings,

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Print/inspect client.Provider() and compare against the values accepted by isRemoteProvider in the sandbox package.
  2. Configure the intended remote provider (e.g. e2b) so the correct RemoteSandboxClient implementation is constructed.
  3. If integrating a new provider, extend isRemoteProvider (and its capabilities) to include it rather than passing an unregistered client.
  4. Fix typos or casing in the provider string in config/env.

Example fix

// before
client := sandbox.NewLocalSandboxClient(...) // Provider() == "local"
lc, err := sandbox.NewSessionBoundManager(client, store, checker, req, timeout)
// after
client, err := sandbox.NewE2BClient(apiKey) // Provider() == "e2b", a supported remote provider
lc, err := sandbox.NewSessionBoundManager(client, store, checker, req, timeout)
Defensive patterns

Strategy: validation

Validate before calling

switch client.Provider() {
case "e2b":
    // supported
default:
    return fmt.Errorf("provider %q is not a supported remote sandbox provider", client.Provider())
}

Type guard

func isSupportedRemoteProvider(p string) bool {
    switch p {
    case "e2b":
        return true
    default:
        return false
    }
}

Try / catch

mgr, err := sandbox.NewSessionBoundManager(client, store, checker, req, timeout)
if err != nil {
    if strings.Contains(err.Error(), "unsupported remote sandbox provider") {
        return fmt.Errorf("config error: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: newRemoteSessionLifecycle (via newE2BIntegrationLifecycle, NewSessionBoundManager, test fixtures) receives a client whose Provider() string is not in the supported remote provider set — typically a local sandbox client or a custom/misconfigured provider name.

Common situations: Config points the session-bound manager at a local sandbox implementation; a provider enum/string was renamed or typo'd (e.g. "e2b " vs "e2b"); custom RemoteSandboxClient plugged in without registering its provider; test fixture built with the wrong fake provider.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/0a46993a45ad9469. Report an issue: GitHub.