Skip to content

Comments

chore: merge release v1.25.1 to main#4542

Closed
Jacksunwei wants to merge 2 commits intomainfrom
release/v1.25.1
Closed

chore: merge release v1.25.1 to main#4542
Jacksunwei wants to merge 2 commits intomainfrom
release/v1.25.1

Conversation

@Jacksunwei
Copy link
Collaborator

Syncs version bump and CHANGELOG from release v1.25.1 to main.

wukath and others added 2 commits February 18, 2026 13:24
When we added the session_lock_map, it resulted in pickling errors during Agent Engine deployment. To fix, we implemented custom getstate and setstate methods to exclude the lock map lock and session lock map from pickling. Closes #4486.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 871056554
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Jacksunwei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request synchronizes the main branch with the v1.25.1 release, incorporating a version update and the corresponding changelog entries. The primary functional change addresses a critical bug in McpSessionManager by implementing custom pickling logic, ensuring that instances of the manager can be serialized and deserialized without issues, which is crucial for its operational stability.

Highlights

  • Version Bump: The project version has been updated to 1.25.1 across relevant configuration and source files.
  • Changelog Update: The CHANGELOG.md file now includes entries for version 1.25.1, specifically noting a bug fix related to pickling errors in McpSessionManager.
  • Pickling Fix for McpSessionManager: Custom __getstate__ and __setstate__ methods were added to McpSessionManager to correctly handle serialization and deserialization, preventing errors with non-picklable attributes like locks and session objects.
  • Unit Test for Pickling: A new unit test was introduced to verify the proper functionality of pickling and unpickling the McpSessionManager.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .github/.release-please-manifest.json
    • Updated the project version to "1.25.1".
  • CHANGELOG.md
    • Added release notes for version 1.25.1.
    • Included a bug fix entry for pickling lock errors in McpSessionManager.
  • src/google/adk/tools/mcp_tool/mcp_session_manager.py
    • Implemented __getstate__ for custom pickling, excluding non-picklable runtime objects.
    • Implemented __setstate__ for custom unpickling, restoring state and re-initializing transient members.
  • src/google/adk/version.py
    • Updated the __version__ string to "1.25.1".
  • tests/unittests/tools/mcp_tool/test_mcp_session_manager.py
    • Added test_pickle_mcp_session_manager to verify pickling and unpickling functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot
Copy link
Collaborator

adk-bot commented Feb 18, 2026

Response from ADK Triaging Agent

Hello @Jacksunwei, thank you for creating this PR!

To help reviewers, could you please add a testing plan section to your PR description to describe how you tested these changes?

This information will help reviewers to review your PR more efficiently. Thanks!

@adk-bot adk-bot added the mcp [Component] Issues about MCP support label Feb 18, 2026
Copy link
Contributor

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

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 merges release v1.25.1, which includes a bug fix for pickling errors in McpSessionManager. The changes introduce __getstate__ and __setstate__ to handle custom pickling of the session manager, along with a new unit test to verify this functionality. The changes look good, but I have identified a couple of minor areas for improvement regarding code redundancy and style.

Comment on lines +520 to +521
self._sessions = {}
self._session_lock_map = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The _sessions and _session_lock_map attributes are already set to empty dictionaries in __getstate__. This state is restored via self.__dict__.update(state) on line 518. Re-initializing them here is redundant and can be removed for better code clarity.

@pytest.mark.asyncio
async def test_pickle_mcp_session_manager(self):
"""Verify that MCPSessionManager can be pickled and unpickled."""
import pickle
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Per PEP 8 (E402), imports should be at the top of the file. Please move import pickle to the module-level imports at the top of the file for consistency and to adhere to standard Python style guidelines.

References
  1. PEP 8 E402: Module level import not at top of file. Imports should usually be on separate lines at the top of the module. (link)

@Jacksunwei Jacksunwei closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp [Component] Issues about MCP support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants