feat: Add cloud session storage for horizontal scaling#466
Open
cdnsteve wants to merge 1 commit intoanthropics:mainfrom
Open
feat: Add cloud session storage for horizontal scaling#466cdnsteve wants to merge 1 commit intoanthropics:mainfrom
cdnsteve wants to merge 1 commit intoanthropics:mainfrom
Conversation
Implements SessionStorage protocol with S3 and GCS reference implementations to enable cloud persistence for session transcripts. This supports: - Horizontal scaling across multiple servers with shared sessions - Ephemeral filesystem environments (containers, serverless) - Extensible architecture for custom backends (Azure Blob, etc.) Key changes: - Add SessionStorage protocol and BaseSessionStorage ABC - Add S3SessionStorage with support for S3-compatible services (DigitalOcean Spaces, Cloudflare R2, MinIO) - Add GCSSessionStorage for Google Cloud Storage - Add SessionSyncManager for automatic sync via hooks - Add session_storage field to ClaudeAgentOptions - Add optional dependencies: [s3], [gcs], [cloud] - Add SessionStorageError for storage failures - Add 60 unit tests for session storage - Add examples for basic usage and caching patterns - Update README with session storage documentation Closes anthropics#432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
SessionStorageprotocol with S3 and GCS implementations for cloud-based session persistence.Use cases:
Installation
Usage
What's included
SessionStorageprotocol +BaseSessionStorageABCS3SessionStorage(works with S3-compatible services)GCSSessionStorageNote: Cloud storage adds 50-500ms latency per operation. Docs include caching patterns for production scale.
Closes #432