Skip to content

fix: Raise StreamableHTTPError on reconnection failure - #3098

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

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
@wukath

wukath commented Jul 27, 2026

Copy link
Copy Markdown
Author

hi @maxisbey! was wondering if you could take a look?

@maxisbey

maxisbey commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, and sorry it sat here without a proper review.

We're closing most of the open PR backlog. v2 is out and changed a lot of the SDK, so many older PRs no longer apply as written, and we're a small team that realistically doesn't have the capacity to work through the rest.

If this still matters to you on v2, the most useful thing you can do is open an issue (or comment on the existing one) with your use case and a repro. Hearing why it matters to you is what we use to decide what to prioritise.

AI Disclaimer

@maxisbey maxisbey closed this Oct 5, 2026
@maxisbey maxisbey added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

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

2 participants