github/copilot-sdk · error

SessionFS capabilities declare SQLite support but the…

Error message

SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider

What it means

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.

Solutions

  1. Extend the provider to implement all SessionFSSqliteProvider methods.
  2. Remove Sqlite from SessionFS.Capabilities if SQLite is not actually supported.
  3. Check the current SDK interface definition for the exact method set required.

Example fix

// before
func (p *myProvider) Read(...) {...} // only base provider
// after
func (p *myProvider) QuerySql(ctx context.Context, q string) (SqliteResult, error) { ... }
// + all other SessionFSSqliteProvider methods
Defensive patterns

Strategy: type-guard

Validate before calling

if _, ok := provider.(SessionFSSqliteProvider); !ok && caps.Sqlite { return errors.New("provider lacks SQLite support") }

Type guard

func supportsSqlite(p SessionFSProvider) bool { _, ok := p.(SessionFSSqliteProvider); return ok }

Try / catch

if _, err := client.CreateSession(ctx, cfg); err != nil && strings.Contains(err.Error(), "SessionFSSqliteProvider") { /* implement missing methods */ }

Prevention

When it happens

Trigger: options.SessionFS.Capabilities.Sqlite is true, but the object returned by config.CreateSessionFSProvider does not implement SessionFSSqliteProvider's methods.

Common situations: 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.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/5331e67b98eacaea. Report an issue: GitHub.

Appendix: source

Thrown at go/client.go:1086

		}
		if bearerTokenProviders := collectBearerTokenProviders(config.Provider, config.Providers); bearerTokenProviders != nil {
			s.registerBearerTokenProviders(bearerTokenProviders)
		}

		c.sessionsMux.Lock()
		c.sessions[sessionID] = s
		c.sessionsMux.Unlock()

		if c.options.SessionFS != nil {
			if config.CreateSessionFSProvider == nil {
				unregisterSession(sessionID, s)
				return nil, fmt.Errorf("CreateSessionFSProvider is required in session config when SessionFS is enabled in client options")
			}
			provider := config.CreateSessionFSProvider(s)
			if c.options.SessionFS.Capabilities != nil && c.options.SessionFS.Capabilities.Sqlite {
				if _, ok := provider.(SessionFSSqliteProvider); !ok {
					unregisterSession(sessionID, s)
					return nil, fmt.Errorf("SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider")
				}
			}
			s.clientSessionAPIs.SessionFS = newSessionFSAdapter(provider)
		}
		return s, nil
	}

	var session *Session
	var registeredSessionID string

	// Pre-register non-cloud sessions BEFORE issuing the RPC so any
	// session-scoped requests the CLI emits during session.create processing
	// (e.g. sessionFs.writeFile for workspace metadata) can be routed to the
	// correct handlers.
	if localSessionID != "" {
		s, err := initializeSession(localSessionID)
		if err != nil {
			return nil, err

View on GitHub (pinned to cd8cf15dc3)