Tencent/WeKnora · error
sandbox: unsupported remote provider %q
Error message
sandbox: unsupported remote provider %q
What it means
Provider identity comes from deps.Client.Provider(). If that provider is not one of the supported remote providers (Cube, E2B, Docker remote), the constructor rejects it — the manager cannot build a provider-specific create request or apply provider defaults for an unknown type.
Source
Thrown at internal/sandbox/session_manager.go:142
if cfg == nil {
cfg = DefaultConfig()
}
if err := ValidateConfig(cfg); err != nil {
return nil, fmt.Errorf("invalid sandbox config: %w", err)
}
if deps.Client == nil {
return nil, errors.New("session bound manager requires a RemoteSandboxClient")
}
if deps.Store == nil {
return nil, errors.New("session bound manager requires a SessionSandboxBindingStore")
}
if deps.Checker == nil {
return nil, errors.New("session bound manager requires a SessionExistenceChecker")
}
provider := deps.Client.Provider()
if !isRemoteProvider(provider) {
return nil, fmt.Errorf("sandbox: unsupported remote provider %q", provider)
}
// Apply the provider's tuning defaults so downstream code reads only
// non-zero TTL / timeout fields. Endpoint defaults are deliberately not
// applied here: this constructor also serves named configs, which must be
// told what they are missing rather than handed a built-in localhost value.
switch provider {
case SandboxTypeCube:
applyCubeRuntimeDefaults(cfg)
case SandboxTypeE2B:
applyE2BRuntimeDefaults(cfg)
case SandboxTypeDocker:
applyDockerRuntimeDefaults(cfg)
}
// Build the provider-specific neutral create request using the
// provider's own template and TTL fields.
createRequest, err := buildSessionCreateRequest(provider, cfg)View on GitHub (pinned to 988cbb0330)
Solutions
- Make deps.Client.Provider() return one of the supported remote provider identifiers
- If using a test fake, set its Provider() to a real provider type (e.g. SandboxTypeDocker)
- Check whether a client wrapper/middleware is dropping or altering the provider value
- Verify you did not intend the non-remote manager constructor for this provider type
Example fix
// before
func (f *fakeClient) Provider() string { return "" }
// after
func (f *fakeClient) Provider() string { return sandbox.SandboxTypeDocker } Defensive patterns
Strategy: validation
Validate before calling
supported := map[string]bool{"cube": true, "e2b": true, "docker": true}
if !supported[deps.Client.Provider()] {
return nil, fmt.Errorf("provider %q unsupported for session-bound manager", deps.Client.Provider())
} Try / catch
mgr, err := sandbox.NewSessionBoundManager(deps)
if err != nil && strings.Contains(err.Error(), "unsupported remote provider") {
return nil, fmt.Errorf("wire a client whose Provider() is a supported remote type: %w", err)
} Prevention
- Assert Client.Provider() in tests before constructing managers
- Keep client wrappers transparent about Provider()
- Only use NewSessionBoundManager for remote providers; use the appropriate constructor otherwise
When it happens
Trigger: Wiring NewSessionBoundManager with a RemoteSandboxClient whose Provider() returns an unsupported/custom/local value — e.g. a stub client in tests, a custom client wrapper forgetting to forward the real provider, or Config.Type / client mismatch after refactoring.
Common situations: Test fakes returning empty Provider() strings; custom client implementations not registered as a remote provider; switching backends via config while the injected client still reports the old provider.
Related errors
- invalid sandbox type
- timeout cannot be negative
- memory limit cannot be negative
- CPU limit cannot be negative
- URL is required for HTTP Streamable transport
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/27493cc5a73b1298.
Report an issue: GitHub.