Repository navigation
Isolate dataframes and tasks in a chat session the model opens once. - #57
Open
diego-ferrand wants to merge 2 commits into
Open
diego-ferrand wants to merge 2 commits into
diego-ferrand wants to merge 2 commits into
Conversation
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.
This pull request introduces several new modules and enhancements to the Perfecto MCP configuration, focusing on environment management, session and credential scoping, random ID generation, HTTP client reuse, remote cache serialization, and storage service authentication. Key changes include the addition of flexible environment variable helpers, context management for user/session identity, a robust cache codec for serializing complex types, and improved infrastructure for partitioned storage and cache selection.
The most important changes are:
Session and Identity Context Management
config/session_context.py, providing context managers and accessors for binding and retrieving the current user identity, session, and credential for each tool call. This enables partitioned storage and task isolation per user/session.config/call_scope.pyto derive stable user and session IDs from tokens and request contexts, ensuring consistent partitioning for storage and cache.Environment and Configuration Handling
config/env.pywith helpers for reading and validating environment variables (string, int, float, bool) with consistent naming and error handling.Cache and Storage Infrastructure
config/cache_codec.pyfor serializing/deserializing complex Python and Pydantic model objects to JSON for remote cache storage, preserving types and supporting non-string dict keys.config/runtime.pyto select between in-memory and HTTP-based storage/cache providers based on environment variables, and to inject storage and cache dependencies into the application runtime. [1] [2] [3] [4]HTTP Client and Service Authentication
config/http_clients.pyto manage shared, cookie-lesshttpx.AsyncClientinstances for efficient connection reuse and proper cleanup on shutdown.config/service_auth.pyfor constructing headers and retrieving service authentication tokens for communication with the hosted storage service.Utilities
config/ids.pyfor generating unambiguous, random base32 IDs used for tasks, dataframes, and chat sessions.Additionally, the server shutdown logic in
config/auth.pywas improved to ensure proper closure of cache and HTTP clients.