{"record":{"id":"5a1a2a755e2887c7","repo":"github/copilot-sdk","slug":"sessionfsconfig-declares-capabilities-sqlite-but-t-5a1a2a","errorCode":null,"errorMessage":"SessionFsConfig declares capabilities.sqlite but the provider does not implement ISessionFsSqliteProvider.","messagePattern":"SessionFsConfig declares capabilities\\.sqlite but the provider does not implement ISessionFsSqliteProvider\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Client.cs","lineNumber":2163,"sourceCode":"    private void ConfigureSessionFsHandlers(CopilotSession session, Func<CopilotSession, SessionFsProvider>? createSessionFsHandler)\n    {\n        if (_options.SessionFs is null)\n        {\n            return;\n        }\n\n        if (createSessionFsHandler is null)\n        {\n            throw new InvalidOperationException(\n                \"CreateSessionFsProvider is required in the session config when CopilotClientOptions.SessionFs is configured.\");\n        }\n\n        var provider = createSessionFsHandler(session)\n            ?? throw new InvalidOperationException(\"CreateSessionFsProvider returned null.\");\n\n        if (_options.SessionFs.Capabilities?.Sqlite == true && provider is not ISessionFsSqliteProvider)\n        {\n            throw new InvalidOperationException(\n                \"SessionFsConfig declares capabilities.sqlite but the provider does not implement ISessionFsSqliteProvider.\");\n        }\n\n        session.ClientSessionApis.SessionFs = provider;\n    }\n\n    private async Task VerifyProtocolVersionAsync(Connection connection, CancellationToken cancellationToken)\n    {\n        var handshakeTimestamp = Stopwatch.GetTimestamp();\n        var usedFallbackPing = false;\n        var maxVersion = SdkProtocolVersion.GetVersion();\n        int? serverVersion;\n        try\n        {\n            var token = _ffiHost is not null\n                ? null // FFI hosting is an ungated in-process connection; no token.\n                : _connection switch\n                {","sourceCodeStart":2145,"sourceCodeEnd":2181,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/dotnet/src/Client.cs#L2145-L2181","documentation":"SessionFsConfig declares `capabilities.sqlite = true`, advertising SQLite support to the server, but the provider instance created by CreateSessionFsProvider does not implement the ISessionFsSqliteProvider interface. The client refuses to attach a provider that cannot honor the declared capability, since the server would issue SQLite operations the provider can't serve.","triggerScenarios":"_options.SessionFs.Capabilities?.Sqlite == true and the created provider fails the `provider is not ISessionFsSqliteProvider` check at Client.cs:2163 during session FS initialization.","commonSituations":"Copying a SessionFsConfig with Sqlite=true from a sample while using a basic in-memory or file provider; upgrading the config but not the provider class; a provider wrapper/decorator class that doesn't forward the ISessionFsSqliteProvider interface.","solutions":["Implement ISessionFsSqliteProvider on your provider class (or have your wrapper delegate to one).","Set Capabilities.Sqlite = false in SessionFsConfig if you don't need SQLite support.","Use a SQLite-capable provider implementation that matches the declared capabilities."],"exampleFix":"// before\npublic class MyFsProvider : ISessionFsProvider { ... }\n\n// after\npublic class MyFsProvider : ISessionFsProvider, ISessionFsSqliteProvider { ... }","handlingStrategy":"validation","validationCode":"if (config.SessionFs?.Capabilities?.Sqlite == true &&\n    provider is not ISessionFsSqliteProvider)\n    throw new InvalidOperationException(\"Provider must implement ISessionFsSqliteProvider\");","typeGuard":"static bool SupportsDeclaredSqlite(SessionFsProvider p, SessionFsConfig c) =>\n    c.Capabilities?.Sqlite != true || p is ISessionFsSqliteProvider;","tryCatchPattern":"try\n{\n    session = await client.CreateSessionAsync(sessionConfig);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"ISessionFsSqliteProvider\"))\n{\n    logger.LogError(ex, \"SessionFs provider does not implement declared sqlite capability\");\n}","preventionTips":["Derive Capabilities from what the provider actually implements instead of hard-coding Sqlite=true.","Add a startup self-check pairing each declared capability with an interface check.","Keep capability flags and provider interfaces updated together in one change."],"tags":["configuration","session-fs","capability-mismatch","type-mismatch"],"backgroundTag":"config-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"}