Skip to content

fix(mcp): MCP Instrumentation: streamablehttp_client Parameter Corruption #3199

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

Merged
merged 3 commits into from
Aug 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,21 @@ async def traced_method(
async with wrapped(*args, **kwargs) as result:
try:
read_stream, write_stream = result
yield InstrumentedStreamReader(
read_stream, tracer
), InstrumentedStreamWriter(write_stream, tracer)
except ValueError:
read_stream, write_stream, _ = result
yield InstrumentedStreamReader(
read_stream, tracer
), InstrumentedStreamWriter(write_stream, tracer)
try:
read_stream, write_stream, get_session_id_callback = result
yield InstrumentedStreamReader(
read_stream, tracer
), InstrumentedStreamWriter(write_stream, tracer), get_session_id_callback
except Exception as e:
logging.warning(f"mcp instrumentation _transport_wrapper exception: {e}")
yield result
except Exception as e:
logging.warning(f"mcp instrumentation transport_wrapper exception: {e}")
yield result

return traced_method

Expand Down