Skip to content
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

Chatbot example: clean up servers in correct order #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clareliguori
Copy link

@clareliguori clareliguori commented Mar 23, 2025

The servers's async context must be exited in the reverse order it was entered, unrolling the context stack.

Motivation and Context

Fixes #252

How Has This Been Tested?

$ python main.py 
You: quit
2025-03-23 08:46:26,961 - INFO - 
Exiting...
$ echo $?
0

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@pagoenka
Copy link

Can confirm that this fixes the issues like - #252, but this will cleanup the servers sequentially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants