Skip to content

fix: improve log clarity for stateless mode session termination#2332

Open
goingforstudying-ctrl wants to merge 1 commit intomodelcontextprotocol:mainfrom
goingforstudying-ctrl:fix-issue-2329-stateless-log
Open

fix: improve log clarity for stateless mode session termination#2332
goingforstudying-ctrl wants to merge 1 commit intomodelcontextprotocol:mainfrom
goingforstudying-ctrl:fix-issue-2329-stateless-log

Conversation

@goingforstudying-ctrl
Copy link

Summary

In stateless HTTP mode, every request logs INFO: Terminating session: None.
This is correct behavior but confusing to users who assume their connection
is failing or being dropped.

Changes

  • Downgrade stateless cleanup to DEBUG (routine, not noteworthy)
  • Use clearer wording: 'Stateless request completed, cleaning up transport'
  • Keep existing INFO-level log for actual session terminations

Fixes #2329

In stateless HTTP mode, every request logs 'INFO: Terminating session: None'.
This is correct behavior but confusing to users who assume their connection
is failing.

Changes:
- Downgrade stateless cleanup to DEBUG (routine, not noteworthy)
- Use clearer wording: 'Stateless request completed, cleaning up transport'
- Keep existing INFO-level log for actual session terminations

Fixes modelcontextprotocol#2329
@owendevereaux
Copy link

Nice fix! The differentiation between session-based (INFO) and stateless (DEBUG) terminations makes the logs much clearer for users. The code change is clean and minimal.

One minor thought: could the stateless debug message include any request context (like a request ID if available) for debugging purposes? Not blocking — just wondering if it would help with troubleshooting. LGTM as-is.

@goingforstudying-ctrl
Copy link
Author

@owendevereaux Thanks for the feedback! Adding request context to the debug message is a good idea for troubleshooting. I'll consider that for a follow-up PR if there's demand. Glad the fix helps clarify the logs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve log clarity for "Terminating session: None" in stateless mode

2 participants