Conversation
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
Summary of ChangesHello @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 Highlights
🧠 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
Using Gemini Code AssistThe 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
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 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
|
|
Response from ADK Triaging Agent Hello @Jacksunwei, thank you for creating this PR! To help reviewers, could you please add a This information will help reviewers to review your PR more efficiently. Thanks! |
There was a problem hiding this comment.
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.
| self._sessions = {} | ||
| self._session_lock_map = {} |
| @pytest.mark.asyncio | ||
| async def test_pickle_mcp_session_manager(self): | ||
| """Verify that MCPSessionManager can be pickled and unpickled.""" | ||
| import pickle |
There was a problem hiding this comment.
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
- 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)
Syncs version bump and CHANGELOG from release v1.25.1 to main.