Skip to content

Conversation

@ywqwancbx
Copy link

  • Context
  • Changes
    • Add Session.passthrough and propagate via stdio/TCP/serverless readers.
    • Extend PluginInStream to carry passthrough.
    • Wire passthrough through IOServer/Plugin into Session.
    • Forward session.passthrough to Tool.invoke in PluginExecutor.
    • Backward-compatible Tool.invoke: prefer _invoke(..., passthrough=...), fallback on TypeError.
  • Compatibility
    • Backward compatible: existing tools without passthrough are unaffected.
    • No breaking changes to public APIs.
  • Related

…ility\n\n- Add Session.passthrough and carry through Readers (stdio/TCP/serverless)\n- Extend PluginInStream to include passthrough field\n- Wire passthrough through IOServer and Plugin into Session\n- Pass session.passthrough to Tool.invoke in PluginExecutor\n- Update Tool.invoke to accept optional passthrough, fallback on TypeError
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ywqwancbx, 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 enhances the Python plugin SDK by integrating a passthrough parameter throughout the plugin invocation lifecycle. This change allows for the seamless transmission of custom, EAM-specific data, eliminating the need for downstream users to maintain a custom SDK. The implementation ensures backward compatibility, preventing any breaking changes to existing tools or public APIs.

Highlights

  • Passthrough Parameter Introduction: A new passthrough parameter has been added to the Session and PluginInStream entities to allow custom data to be carried through the plugin invocation process.
  • Passthrough Propagation: The passthrough parameter is now propagated through various request readers, including stdio, TCP, and serverless, ensuring it reaches the Session object.
  • Tool Invocation Update: The Tool.invoke method in PluginExecutor now forwards the session.passthrough value to the underlying tool implementation.
  • Backward Compatibility for Tool Invocation: The Tool.invoke method has been made backward-compatible. It attempts to call the internal _invoke method with the passthrough parameter, but falls back to calling it without passthrough if a TypeError occurs, ensuring existing tools without passthrough support remain functional.
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.

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 successfully adds a passthrough parameter to the Python plugin SDK, enabling data to be passed down to the tool invocation layer. The changes are well-implemented, primarily involving the propagation of the new parameter through various method calls and constructors. My review includes one suggestion to improve the robustness of the backward compatibility mechanism in Tool.invoke to prevent unintended error suppression.

Comment on lines +366 to +367
except TypeError:
return self._invoke(tool_parameters)
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 broad except TypeError is a bit risky as it could catch any TypeError from within the _invoke implementation, not just the one for an unexpected keyword argument. This could hide bugs in the tool's code.

To make this safer, you can inspect the TypeError to ensure it's the specific one you want to handle for backward compatibility, and re-raise any others.

Suggested change
except TypeError:
return self._invoke(tool_parameters)
except TypeError as e:
if "unexpected keyword argument" in str(e):
return self._invoke(tool_parameters)
raise

@Mairuis Mairuis closed this Nov 24, 2025
@Mairuis
Copy link
Collaborator

Mairuis commented Dec 8, 2025

Please accept my sincere apologies for the incorrect closure of your pull request due to a technical issue in the trigger test. This was an operational mistake on our side, and I deeply regret any inconvenience this may have caused. Your PR has been reopened accordingly. Thank you for your understanding. @ywqwancbx

@Mairuis Mairuis reopened this Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants