{"record":{"id":"445504d9a643fe77","repo":"github/copilot-sdk","slug":"sqlite-transactions-are-not-supported-by-this-sess","errorCode":null,"errorMessage":"SQLite transactions are not supported by this SessionFs provider","messagePattern":"SQLite transactions are not supported by this SessionFs provider","errorType":"exception","errorClass":"SessionFsSqliteTransactionFailure","httpStatus":null,"severity":"error","filePath":"python/copilot/session_fs_provider.py","lineNumber":152,"sourceCode":"    ) -> SessionFsSqliteQueryResult | None:\n        \"\"\"Execute a SQLite query against the provider's per-session database.\n\n        Return ``None`` for exec-type queries (DDL / multi-statement) where\n        no result set is produced; the adapter will substitute an empty result.\n        \"\"\"\n\n    async def sqlite_transaction(\n        self,\n        statements: list[SessionFSSqliteTransactionStatement],\n    ) -> list[SessionFsSqliteQueryResult]:\n        \"\"\"Execute ``statements`` atomically against the per-session database.\n\n        Return one result per statement, in order.  Raise\n        :class:`SessionFsSqliteTransactionFailure` to tell the runtime how the\n        failure should be classified; any other exception is reported as\n        ``fatal``.\n        \"\"\"\n        raise SessionFsSqliteTransactionFailure(\n            \"SQLite transactions are not supported by this SessionFs provider\",\n            SessionFSSqliteTransactionErrorClass.FATAL,\n        )\n\n    @abc.abstractmethod\n    async def sqlite_exists(self) -> bool:\n        \"\"\"Return whether the provider has a SQLite database for this session.\"\"\"\n\n\nclass SessionFsSqliteTransactionFailure(Exception):\n    \"\"\"Raised by a provider to classify a failed SQLite transaction.\n\n    ``busy_or_locked`` guarantees the transaction rolled back and is safe to\n    retry; ``post_commit_ambiguous`` must never be retried.\n    \"\"\"\n\n    def __init__(\n        self,","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/python/copilot/session_fs_provider.py#L134-L170","documentation":"The base SessionFsSqliteProvider.sqlite_transaction method raises this SessionFsSqliteTransactionFailure (FATAL class) by default. It signals that the installed SessionFs provider implements sqlite_query/sqlite_exists but does not override sqlite_transaction, so atomic multi-statement execution is not available.","triggerScenarios":"The runtime issues a SessionFS SQLite transaction request against a provider that subclasses SessionFsProvider + SessionFsSqliteProvider but relies on the default (non-overridden) sqlite_transaction implementation, or dispatches a transaction against a plain SessionFsProvider lacking SQLite support.","commonSituations":"Custom file-system provider author forgot to implement sqlite_transaction after implementing sqlite_query; upgrading the SDK adds transaction support to the runtime while a user's older custom provider predates it; accidentally registering a minimal provider where the app's tools use multi-statement SQLite workflows.","solutions":["Implement sqlite_transaction in your provider (subclass SessionFsSqliteProvider and override it), running the statements atomically and returning one result per statement.","If atomicity is not needed, override sqlite_transaction to run each statement via sqlite_query in order and return the results (accepting loss of atomicity).","If your provider genuinely has no SQLite database, ensure sqlite_exists returns False so the runtime does not dispatch transaction calls, and avoid tools that require SQLite.","Check that the provider instance actually inherits both SessionFsProvider and SessionFsSqliteProvider so the isinstance dispatch routes calls correctly."],"exampleFix":"// before\nclass MyProvider(SessionFsProvider, SessionFsSqliteProvider):\n    async def sqlite_query(self, query_type, query, params=None): ...\n    # sqlite_transaction not overridden -> FATAL failure\n// after\nclass MyProvider(SessionFsProvider, SessionFsSqliteProvider):\n    async def sqlite_query(self, query_type, query, params=None): ...\n    async def sqlite_transaction(self, statements):\n        results = []\n        for stmt in statements:\n            r = await self.sqlite_query(stmt.query_type, stmt.query, stmt.params)\n            results.append(r)\n        return results","handlingStrategy":"validation","validationCode":"if not isinstance(provider, SessionFsSqliteProvider):\n    raise RuntimeError('provider does not support SQLite operations')\n# also check provider overrides the transaction method:\nif type(provider).sqlite_transaction is SessionFsSqliteProvider.sqlite_transaction:\n    raise RuntimeError('provider does not implement sqlite_transaction')","typeGuard":"def supports_sqlite_transactions(provider) -> bool:\n    return (\n        isinstance(provider, SessionFsSqliteProvider)\n        and type(provider).sqlite_transaction is not SessionFsSqliteProvider.sqlite_transaction\n    )","tryCatchPattern":"try:\n    results = await provider.sqlite_transaction(statements)\nexcept SessionFsSqliteTransactionFailure as exc:\n    if exc.error_class == SessionFSSqliteTransactionErrorClass.FATAL:\n        raise  # transactions unsupported here; do not retry\n    # busy_or_locked is safe to retry; post_commit_ambiguous never retry","preventionTips":["When implementing a provider, override every abstract/default SQLite method you intend to support.","Unit-test your provider against the runtime's SQLite call paths before deploying.","Run the SDK's provider conformance checks (sqlite_exists returning False if you truly have no DB).","Keep provider implementations in sync with SDK upgrades that add new SessionFsSqliteProvider methods."],"tags":["python","sessionfs","sqlite","provider","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}