fix: extract client info per-request in stateless mode#28
Merged
kashishhora merged 1 commit intomainfrom Apr 1, 2026
Merged
Conversation
naji247
approved these changes
Mar 31, 2026
Comment on lines
+253
to
+257
| if request.params and hasattr(request.params, 'clientInfo') and request.params.clientInfo: | ||
| client_name = request.params.clientInfo.name | ||
| client_version = getattr(request.params.clientInfo, 'version', None) | ||
| if not client_name: | ||
| client_name, client_version = get_client_info_from_request_context(server, request_context) |
Member
There was a problem hiding this comment.
Did you do a db look up to see what they look like?
Separately, I'm worried initialized is either:
- Not consistently published via the Python SDK
- May have a different client ID and version than is advertised via headers
Not sure how you want to handle that since it may mean new sessions created incorrectly...
Member
There was a problem hiding this comment.
Maybe good to do an analysis on DB for some of these questions :|
Member
Author
There was a problem hiding this comment.
Will look into this as a separate PR. Can merge this for now since it's still a beta version.
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
In stateless mode, the SDK cached client_name/client_version from the first request and applied it to all subsequent users on the shared server. A customer reported all sessions showing "Cursor/2.6.22" even for Claude/Codex users.
Fix: same pattern as the identity fix — extract client info per-request, set directly on each event, skip the session_info merge in stateless mode so event-level values survive. Also extracts
clientInfofrom MCPInitializeRequestparams in low-level handlers (was a TODO).Bumps version to
0.1.15b2.Depends on
Test plan
test_stateless.py