Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves error messages and logging for MCP clients and hosted servers by dynamically identifying whether the connection is a standalone client or a hosted server. It introduces a _target property to format the target name and host appropriately, updating connection-closed and connection-failed exceptions to use this property. Corresponding unit tests have been added and updated to verify these changes. I have no feedback to provide as there are no review comments.
|
Hi @yumin2002 — heads up that Genkit Python SDK development has moved to https://github.com/genkit-ai/genkit-python! Could you re-open this PR over there (file paths map 1:1 after stripping the leading py/ prefix; see also genkit-ai/genkit-python#72), and link/close this PR once moved? cc @huangjeff5 |
Why
Fixes genkit-ai/genkit-python#204. When a server runs behind
McpHost, threeMcpClientpaths still identify it as a standalone client. Two hosts can each contain a server with the same name, so messages such asMCP client 'git' is closeddo not identify which host failed.Connection errors already include the host after #6930, but client-level closed and restarted errors, and the cross-event-loop close timeout warning, do not.
Changes
MCP server <name> on host <host>, while preserving the existing standalone client text.serverandhostfields, while retainingclientfor standalone clients.Verification
.venv/bin/python -m pytest py/packages/genkit-mcp/tests(257 passed).venv/bin/ruff format --checkon the three changed files.venv/bin/ruff checkon the three changed filesgit diff --check origin/main...HEAD@huangjeff5 I noticed your note in #6930 that Python changes should go to genkit-python now. Should I move this genkit-ai/genkit-python#204 follow-up there? If this PR is still targeting the correct repository, would you mind taking a look? Thank you!