Skip to content

Conversation

MohanLaksh
Copy link
Collaborator

@MohanLaksh MohanLaksh commented Oct 17, 2025

- Session Pooling:

This feature implements session persistence across tool calls and session pooling to address performance bottlenecks and state continuity issues in Context Forge. The approach prioritizes using existing stateful session support (USE_STATEFUL_SESSIONS) and extending it to SSE and WS transports.

The solution addresses two complementary scenarios:

Streamable HTTP: Prefer single persistent client↔gateway↔server session (controlled by USE_STATEFUL_SESSIONS)
SSE/WebSocket: Introduce in-gateway session pool keyed by (user, server) to avoid re-initialization

*** What is implemented ***

  1. Enabled Existing Stateful Sessions for streamablehttp_transport
  2. Implemented Core Session Pool Infrastructure (session_pool.py)
  3. Integration with sse_endpoint, message_endpoint and websocket_endpoint
  4. Enhancements to sse_transport and websocket_transport`
  5. Strategy resolution in server_service
  6. Session pool configuration in config

*** What is pending ***

  1. Implementation of per-server session strategy in schemas
  2. Test cases in test_session_pool
  3. Alembic migration after adding per-server strategy
  4. Integration of session pool metrics in Observability
  5. Session pool UI management in UI - admin
  6. ...

@MohanLaksh MohanLaksh added the enhancement New feature or request label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants