Skip to content

fix: Raise StreamableHTTPError on reconnection failure#3098

Open
wukath wants to merge 6 commits into
modelcontextprotocol:mainfrom
wukath:fix-streamable-http-hang
Open

fix: Raise StreamableHTTPError on reconnection failure#3098
wukath wants to merge 6 commits into
modelcontextprotocol:mainfrom
wukath:fix-streamable-http-hang

Conversation

@wukath

@wukath wukath commented Jul 15, 2026

Copy link
Copy Markdown

Motivation and Context

Raise StreamableHTTPError on reconnection failure when the GET stream connection fails and exceeds MAX_RECONNECTION_ATTEMPTS instead of returning silently.

Currently, when the GET stream connection fails and exceeds MAX_RECONNECTION_ATTEMPTS, the transport receive loop returns silently. This prevents the failure from propagating out of the transport receive loop, causing downstream agents/sessions to hang rather than cleanly identifying the disconnection and reporting the failure.

Fixes google/adk-python#2615.

How Has This Been Tested?

  • Added test_reconnect_failure_propagates_error to tests/shared/test_streamable_http.py to assert that complete reconnection failure propagates the StreamableHTTPError.
  • Executed pytest locally to verify all transport tests pass.

Breaking Changes

No breaking changes. This corrects silent failures and hangs into expected transport exception propagation.

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

@wukath wukath force-pushed the fix-streamable-http-hang branch from d7b5872 to 762dfb3 Compare July 15, 2026 22:47

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/mcp/client/streamable_http.py Outdated
Comment thread src/mcp/client/streamable_http.py
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.

adk agent hangs when using MCPToolset to connect to a remote streamable HTTP MCP Server hosted in Cloud Run

1 participant