{"record":{"id":"5331e67b98eacaea","repo":"github/copilot-sdk","slug":"sessionfs-capabilities-declare-sqlite-support-but-5331e6","errorCode":null,"errorMessage":"SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider","messagePattern":"SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/client.go","lineNumber":1086,"sourceCode":"\t\t}\n\t\tif bearerTokenProviders := collectBearerTokenProviders(config.Provider, config.Providers); bearerTokenProviders != nil {\n\t\t\ts.registerBearerTokenProviders(bearerTokenProviders)\n\t\t}\n\n\t\tc.sessionsMux.Lock()\n\t\tc.sessions[sessionID] = s\n\t\tc.sessionsMux.Unlock()\n\n\t\tif c.options.SessionFS != nil {\n\t\t\tif config.CreateSessionFSProvider == nil {\n\t\t\t\tunregisterSession(sessionID, s)\n\t\t\t\treturn nil, fmt.Errorf(\"CreateSessionFSProvider is required in session config when SessionFS is enabled in client options\")\n\t\t\t}\n\t\t\tprovider := config.CreateSessionFSProvider(s)\n\t\t\tif c.options.SessionFS.Capabilities != nil && c.options.SessionFS.Capabilities.Sqlite {\n\t\t\t\tif _, ok := provider.(SessionFSSqliteProvider); !ok {\n\t\t\t\t\tunregisterSession(sessionID, s)\n\t\t\t\t\treturn nil, fmt.Errorf(\"SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider\")\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.clientSessionAPIs.SessionFS = newSessionFSAdapter(provider)\n\t\t}\n\t\treturn s, nil\n\t}\n\n\tvar session *Session\n\tvar registeredSessionID string\n\n\t// Pre-register non-cloud sessions BEFORE issuing the RPC so any\n\t// session-scoped requests the CLI emits during session.create processing\n\t// (e.g. sessionFs.writeFile for workspace metadata) can be routed to the\n\t// correct handlers.\n\tif localSessionID != \"\" {\n\t\ts, err := initializeSession(localSessionID)\n\t\tif err != nil {\n\t\t\treturn nil, err","sourceCodeStart":1068,"sourceCodeEnd":1104,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/client.go#L1068-L1104","documentation":"If SessionFS capabilities declare SQLite support, the provider built by CreateSessionFSProvider must also implement the SessionFSSqliteProvider interface. CreateSession type-asserts the provider and fails with this error when the assertion does not hold, unregistering the session.","triggerScenarios":"options.SessionFS.Capabilities.Sqlite is true, but the object returned by config.CreateSessionFSProvider does not implement SessionFSSqliteProvider's methods.","commonSituations":"Implementing the basic SessionFSProvider but forgetting the SQLite extension methods; declaring capabilities in config that overstate what the provider supports; interface drift after an SDK upgrade.","solutions":["Extend the provider to implement all SessionFSSqliteProvider methods.","Remove Sqlite from SessionFS.Capabilities if SQLite is not actually supported.","Check the current SDK interface definition for the exact method set required."],"exampleFix":"// before\nfunc (p *myProvider) Read(...) {...} // only base provider\n// after\nfunc (p *myProvider) QuerySql(ctx context.Context, q string) (SqliteResult, error) { ... }\n// + all other SessionFSSqliteProvider methods","handlingStrategy":"type-guard","validationCode":"if _, ok := provider.(SessionFSSqliteProvider); !ok && caps.Sqlite { return errors.New(\"provider lacks SQLite support\") }","typeGuard":"func supportsSqlite(p SessionFSProvider) bool { _, ok := p.(SessionFSSqliteProvider); return ok }","tryCatchPattern":"if _, err := client.CreateSession(ctx, cfg); err != nil && strings.Contains(err.Error(), \"SessionFSSqliteProvider\") { /* implement missing methods */ }","preventionTips":["Implement the full interface your capabilities declare","Add compile-time assertion: var _ SessionFSSqliteProvider = (*myProvider)(nil)","Re-check interfaces after SDK upgrades"],"tags":["go","interface","filesystem"],"backgroundTag":"type-mismatch","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}