Skip to content

fix(py/plugins/mcp): stop tests using the removed GenkitError.cause - #7153

Merged
hilariie merged 1 commit into
mainfrom
fix/py-mcp-tests-genkit-error-cause
Nov 10, 2026
Merged

hilariie merged 1 commit into
mainfrom
fix/py-mcp-tests-genkit-error-cause

Conversation

@hilariie

Copy link
Copy Markdown
Contributor

Why

#6930 was tested against a main from before #6767, which removed GenkitError.cause and GenkitError.to_serializable(). Its tests in mcp_connection_test.py still use both, so main has 5 genkit-mcp pytest failures and 5 ty unresolved-attribute errors.

Changes

  • Check the attached cause with attached_cause(error) instead of error.cause.
  • Check the Dev UI message with get_reflection_json(error).message instead of error.to_serializable().message.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the test suite in mcp_connection_test.py to use the helper functions attached_cause and get_reflection_json from genkit._core._error instead of directly accessing the cause attribute or calling to_serializable() on error objects. There are no review comments, and I have no additional feedback to provide.

@cabljac cabljac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@hilariie
hilariie merged commit 494584f into main Nov 10, 2026
27 checks passed
@hilariie
hilariie deleted the fix/py-mcp-tests-genkit-error-cause branch November 10, 2026 12:55
@huangjeff5

Copy link
Copy Markdown
Contributor

Ported to genkit-python in genkit-ai/genkit-python#72 (git am -p2, authorship preserved, Upstream-PR trailer points back here). Python changes go to genkit-python from now on.

huangjeff5 added a commit to genkit-ai/genkit-python that referenced this pull request Nov 10, 2026
Upstream-Commit: genkit-ai/genkit@d0d2e7a
Upstream-PR: genkit-ai/genkit#6930
Upstream-Commit: genkit-ai/genkit@494584f
Upstream-PR: genkit-ai/genkit#7153

Co-authored-by: Hilary Chukwuma <holaryc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants