Skip to content

fix: avoid infinite recursion#111

Merged
wzxxing merged 1 commit into
aws:mainfrom
wzxxing:init-client
Dec 4, 2025
Merged

fix: avoid infinite recursion#111
wzxxing merged 1 commit into
aws:mainfrom
wzxxing:init-client

Conversation

@wzxxing

@wzxxing wzxxing commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Summary

Previously, the _connect method retries on RuntimeError. This can cause infinite recursion if

  1. the network is down
  2. there were legit McpError that terminate the session.

This fix ensures that

  1. when a RuntimeError wraps an McpError, the underlying McpError is properly extracted and raised (user does not have the permission to InvokeMcp)
  2. connection retries only on TimeoutException for at most 3 times.

Changes

Please provide a summary of what's being changed

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? (Y/N)

  • Yes
  • No

Please add details about how this change was tested.

  • Did integration tests succeed?
  • If the feature is a new use case, is it necessary to add a new integration test case?

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

can happen when the network is down and connect keeps failing
@wzxxing wzxxing requested a review from a team as a code owner December 4, 2025 09:30
@wzxxing wzxxing requested review from acornea and awsjjzhou December 4, 2025 09:30
@wzxxing wzxxing merged commit 58fb7c9 into aws:main Dec 4, 2025
3 checks passed
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.

4 participants