{"record":{"id":"4689c3d04839d185","repo":"Tencent/WeKnora","slug":"remote-sandbox-provider-q-does-not-support-reconn","errorCode":null,"errorMessage":"remote sandbox provider %q does not support reconnect","messagePattern":"remote sandbox provider %q does not support reconnect","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sandbox/session_lifecycle.go","lineNumber":70,"sourceCode":"\tsessionChecker SessionExistenceChecker,\n\tcreateRequest RemoteCreateRequest,\n\tcleanupTimeout time.Duration,\n\tsandboxConfigID string,\n) (*remoteSessionLifecycle, error) {\n\tif client == nil {\n\t\treturn nil, errors.New(\"remote sandbox client is required\")\n\t}\n\tif bindings == nil {\n\t\treturn nil, errors.New(\"session sandbox binding store is required\")\n\t}\n\tif sessionChecker == nil {\n\t\treturn nil, errors.New(\"session existence checker is required\")\n\t}\n\tif !isRemoteProvider(client.Provider()) {\n\t\treturn nil, fmt.Errorf(\"unsupported remote sandbox provider %q\", client.Provider())\n\t}\n\tif !client.Capabilities().SupportsReconnect {\n\t\treturn nil, fmt.Errorf(\"remote sandbox provider %q does not support reconnect\", client.Provider())\n\t}\n\tif strings.TrimSpace(createRequest.TemplateID) == \"\" {\n\t\treturn nil, errors.New(\"remote sandbox template ID is required\")\n\t}\n\tif cleanupTimeout <= 0 {\n\t\treturn nil, errors.New(\"remote sandbox cleanup timeout must be positive\")\n\t}\n\tif strings.TrimSpace(sandboxConfigID) == \"\" {\n\t\tsandboxConfigID = types.SandboxConfigIDGlobalDefault\n\t}\n\tcreateRequest.Metadata = cloneMetadata(createRequest.Metadata)\n\tcreateRequest.EnvVars = cloneMetadata(createRequest.EnvVars)\n\treturn &remoteSessionLifecycle{\n\t\tclient:          client,\n\t\tbindings:        bindings,\n\t\tsessionChecker:  sessionChecker,\n\t\tcreateRequest:   createRequest,\n\t\tcleanupTimeout:  cleanupTimeout,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/sandbox/session_lifecycle.go#L52-L88","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use a provider client whose Capabilities().SupportsReconnect is true (e.g. the full e2b integration).","If you own the client implementation, implement reconnect (Get/attach to existing sandbox by ID) and correctly report SupportsReconnect in Capabilities().","Check for recent provider client changes that unset the capability flag and restore it.","Verify you are not accidentally constructing the non-reconnecting test/stub client in production code paths."],"exampleFix":"// before\nfunc (c *myClient) Capabilities() RemoteCapabilities {\n    return RemoteCapabilities{SupportsReconnect: false}\n}\n// after\nfunc (c *myClient) Capabilities() RemoteCapabilities {\n    return RemoteCapabilities{SupportsReconnect: true} // after implementing Get-by-ID reconnect\n}","handlingStrategy":"validation","validationCode":"if !client.Capabilities().SupportsReconnect {\n    return errors.New(\"selected sandbox client cannot reconnect; session-bound manager requires it\")\n}","typeGuard":"func supportsReconnect(c sandbox.RemoteSandboxClient) bool {\n    return c != nil && c.Capabilities().SupportsReconnect\n}","tryCatchPattern":"mgr, err := sandbox.NewSessionBoundManager(client, store, checker, req, timeout)\nif err != nil {\n    if strings.Contains(err.Error(), \"does not support reconnect\") {\n        return fmt.Errorf(\"swap to a reconnect-capable provider client: %w\", err)\n    }\n    return err\n}","preventionTips":["Assert SupportsReconnect in integration tests for every custom RemoteSandboxClient.","Do not wire test/stub clients into production lifecycle paths.","Re-run capability checks after provider SDK upgrades.","Document capability requirements next to your sandbox config schema."],"tags":["configuration","sandbox","capabilities","reconnect"],"backgroundTag":"capability-not-supported","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}