{"record":{"id":"0a9c497d426b1ad2","repo":"github/copilot-sdk","slug":"create-session-fs-handler-is-required-in-session-c","errorCode":null,"errorMessage":"create_session_fs_handler is required in session config when session_fs is enabled in client options.","messagePattern":"create_session_fs_handler is required in session config when session_fs is enabled in client options\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/copilot/client.py","lineNumber":2877,"sourceCode":"            \"\"\"\n            setup_start = time.perf_counter()\n            s = CopilotSession(\n                sid,\n                self._client,\n                workspace_path=None,\n                managed_settings_enabled=enable_managed_settings is True\n                or managed_settings is not None,\n                on_disconnect=(\n                    None\n                    if github_token_provider_registration_id is None\n                    else lambda: self._unregister_github_token_provider(\n                        github_token_provider_registration_id\n                    )\n                ),\n            )\n            if self._session_fs_config:\n                if create_session_fs_handler is None:\n                    raise ValueError(\n                        \"create_session_fs_handler is required in session config when \"\n                        \"session_fs is enabled in client options.\"\n                    )\n                fs_provider: SessionFsProvider = create_session_fs_handler(s)\n                caps = self._session_fs_config.get(\"capabilities\")\n                if caps and caps.get(\"sqlite\"):\n                    from .session_fs_provider import SessionFsSqliteProvider\n\n                    if not isinstance(fs_provider, SessionFsSqliteProvider):\n                        raise ValueError(\n                            \"SessionFs capabilities declare SQLite support but the provider \"\n                            \"does not implement SessionFsSqliteProvider\"\n                        )\n                s._client_session_apis.session_fs = create_session_fs_adapter(fs_provider)\n            s._register_tools(tools)\n            s._register_commands(commands)\n            s._register_permission_handler(on_permission_request)\n            s._register_mcp_auth_handler(on_mcp_auth_request)","sourceCodeStart":2859,"sourceCodeEnd":2895,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/python/copilot/client.py#L2859-L2895","documentation":"Validation inside create_session: the client was constructed with session_fs enabled (a session_fs config is present in client options), which requires a per-session filesystem handler factory, but create_session was called without create_session_fs_handler. The session cannot mount its virtual filesystem without it, so construction aborts.","triggerScenarios":"Thrown at python/copilot/client.py:2877 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a create_session_fs_handler callable to create_session","Build the handler from the session_fs config supplied in the client options","Disable session_fs in the client options if the session does not need a virtual filesystem"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}