Skip to content

Support pluggable session storage backends #460

@anthonychu

Description

@anthonychu

Problem Statement

The SDK currently persists all session state to a hardcoded filesystem path (~/.copilot/session-state/{sessionId}/). While this works well for single-node and local development scenarios, it creates significant challenges for production deployments that need:

  1. Horizontally scaled services: Multiple server instances can't share session state without a shared filesystem or sticky sessions.
  2. Serverless / ephemeral compute: Environments like Azure Functions, or short-lived containers have no durable local filesystem at all.
  3. Custom retention and compliance: Organizations may need session data stored in specific databases or regions for audit, TTL, or data residency requirements.
  4. Operational consistency: Teams already running Redis, PostgreSQL, etc for other application state want to use the same infrastructure for session data rather than bolting on a filesystem dependency.

Currently this can be achieved by mounting a share as described in ~/.copilot/session-state/ to a shared volume (as described in the Session Persistence guide). It works but this isn't practical or possible in all situations.

Proposed Solution

Introduce a session store abstraction in SDKs to allow saving and rehydrating sessions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions