Tencent/WeKnora · error

remote sandbox provider %q does not support reconnect

Error message

remote sandbox provider %q does not support reconnect

What it means

newRemoteSessionLifecycle requires that the remote sandbox client advertises SupportsReconnect in its Capabilities(), because the session-bound lifecycle re-attaches to a persistent sandbox across resolves and turns. If the provider client does not support reconnecting to an existing sandbox, construction fails with this error naming the provider. It prevents silent data loss: a non-reconnecting provider would create a fresh sandbox per resolve and drop /workspace state.

Source

Thrown at internal/sandbox/session_lifecycle.go:70

	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,
		sessionChecker:  sessionChecker,
		createRequest:   createRequest,
		cleanupTimeout:  cleanupTimeout,

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Use a provider client whose Capabilities().SupportsReconnect is true (e.g. the full e2b integration).
  2. If you own the client implementation, implement reconnect (Get/attach to existing sandbox by ID) and correctly report SupportsReconnect in Capabilities().
  3. Check for recent provider client changes that unset the capability flag and restore it.
  4. Verify you are not accidentally constructing the non-reconnecting test/stub client in production code paths.

Example fix

// before
func (c *myClient) Capabilities() RemoteCapabilities {
    return RemoteCapabilities{SupportsReconnect: false}
}
// after
func (c *myClient) Capabilities() RemoteCapabilities {
    return RemoteCapabilities{SupportsReconnect: true} // after implementing Get-by-ID reconnect
}
Defensive patterns

Strategy: validation

Validate before calling

if !client.Capabilities().SupportsReconnect {
    return errors.New("selected sandbox client cannot reconnect; session-bound manager requires it")
}

Type guard

func supportsReconnect(c sandbox.RemoteSandboxClient) bool {
    return c != nil && c.Capabilities().SupportsReconnect
}

Try / catch

mgr, err := sandbox.NewSessionBoundManager(client, store, checker, req, timeout)
if err != nil {
    if strings.Contains(err.Error(), "does not support reconnect") {
        return fmt.Errorf("swap to a reconnect-capable provider client: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Constructing the lifecycle with a RemoteSandboxClient whose Capabilities().SupportsReconnect is false — e.g. a stub/limited client, or a provider integration that has not implemented reconnect — passed via newE2BIntegrationLifecycle or NewSessionBoundManager.

Common situations: Using a minimal or custom RemoteSandboxClient wrapper that forgot to set SupportsReconnect=true; a provider SDK upgrade/downgrade that reset capability flags; intentionally using a non-reconnecting fake in production wiring by mistake.

Related errors


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