-
Notifications
You must be signed in to change notification settings - Fork 73
feat: add session management for proxy #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a7f4b00
to
010e789
Compare
293c715
to
b142eb1
Compare
Adds a session interface to proxy, and initialize with the extracted session id from transport messages Only enable healthchecks when we detect that the server has been initialized Closes: #1078
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds session management capabilities to the transparent proxy to track MCP sessions and conditionally enable health checks. The implementation extracts session IDs from transport messages (both headers and SSE streams) and only enables health monitoring once the server has been initialized.
Key changes include:
- Session management infrastructure with TTL-based cleanup for proxy sessions
- Session ID detection from HTTP headers and Server-Sent Events (SSE) streams
- Conditional health check activation based on server initialization state
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
pkg/transport/session/proxy_session.go | Implements ProxySession struct with session tracking capabilities |
pkg/transport/session/manager.go | Core session manager with TTL cleanup and thread-safe operations |
pkg/transport/session/manager_test.go | Comprehensive test suite for session manager functionality |
pkg/transport/proxy/transparent/transparent_proxy.go | Enhanced proxy with session detection and conditional health checks |
pkg/transport/proxy/transparent/transparent_test.go | Tests for session ID detection in SSE and header scenarios |
Adds a session interface to proxy, and initialize with the extracted session id from transport messages
Only enable healthchecks when we detect that the server has been initialized
Closes: #1078