FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: support MCP 2 timeout values by mikemikimike · Pull Request #6940 · google/adk-python · GitHub

fix: support MCP 2 timeout values - #6940

Closed
mikemikimike wants to merge 1 commit into
google:mainfrom
mikemikimike:fix/mcp-v2-read-timeout
Closed

fix: support MCP 2 timeout values#6940
mikemikimike wants to merge 1 commit into
google:mainfrom
mikemikimike:fix/mcp-v2-read-timeout

Conversation

Copy link
Copy Markdown

Issue

Closes #6938.

Summary

MCP 2.x expects timeout values as float seconds, but _read_timeout() always returned datetime.timedelta, causing anyio.fail_after() to fail during MCP session initialization. This keeps the existing MCP 1.x conversion and returns the original float for MCP 2.x.

Testing plan

  • python -m compileall -q src/google/adk/tools/mcp_tool/session_context.py tests/unittests/tools/mcp_tool/test_session_context.py — passed
  • git diff --check — passed
  • Focused pytest — not run: the host has Pydantic 1.x while ADK requires Pydantic 2.x, so collection fails before tests execute.
  • Ruff on the two touched files — reports two pre-existing unused imports in test_session_context.py (AsyncExitStack and ClientSession); no new lint findings were introduced.

The regression tests cover MCP 1.x timedelta behavior, MCP 2.x float behavior, None, zero, and fractional values. No external service is required.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

_read_timeout returns timedelta on mcp 2.x, breaking every MCP session (docstring describes the missing branch)

2 participants


Back | FazBrowse Home | New Git URL