Skip to content

feat!: realligned client API on actions -- remote actions are now actions#21

Draft
pavelgj wants to merge 7 commits into
mainfrom
pj/client-api-updates
Draft

feat!: realligned client API on actions -- remote actions are now actions#21
pavelgj wants to merge 7 commits into
mainfrom
pj/client-api-updates

Conversation

@pavelgj

@pavelgj pavelgj commented Jan 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @pavelgj, 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 introduces a significant architectural change by integrating RemoteAction into the Action hierarchy. This unification simplifies the client API, making it more consistent for defining and invoking both local and remote operations. It also enhances the framework's ability to handle streaming operations efficiently and reliably, particularly within the genkit_shelf server environment, by ensuring proper stream cancellation and preventing output buffering.

Highlights

  • API Unification: The RemoteAction class now extends the base Action class, unifying the client API for both local and remote actions under a single interface.
  • Required Action Naming: A name parameter is now required when defining remote actions via defineRemoteAction, improving observability and identification.
  • Streamlined Execution: The internal execution logic for RemoteAction has been refactored to leverage the Action's fn getter, handling both direct and streaming calls more consistently.
  • Improved Cancellation Handling: An onCancel callback has been added to ActionFnArg and integrated into RemoteAction's streaming logic, allowing for better management of stream cancellations.
  • Shelf Streaming Optimization: The genkit_shelf package now explicitly disables output buffering for streaming responses, ensuring real-time chunk delivery for streaming flows.
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.

@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 introduces a significant and welcome refactoring by aligning the RemoteAction client API with the core Action class. By making RemoteAction extend Action, the client-side API becomes more consistent and integrated with the rest of the Genkit framework. The changes are comprehensive, touching core logic, client implementation, server-side handlers, tests, and examples.

Key improvements include:

  • RemoteAction now inherits from Action, unifying the action concept.
  • The invocation signature for remote actions is now consistent with local actions.
  • Cancellation support has been propagated through the action layer and into RemoteAction.
  • A critical fix for HTTP streaming in genkit_shelf has been implemented, correctly disabling output buffering, and is backed by a solid new test case.

The updates to the tests and examples to reflect these breaking changes are thorough. My review has identified a couple of minor opportunities for code refinement in client.dart to improve robustness and reduce duplication, but overall, this is a solid improvement to the library's architecture and usability.

Comment thread packages/genkit/lib/src/client/client.dart Outdated
Comment thread packages/genkit/lib/src/client/client.dart Outdated
pavelgj and others added 4 commits January 14, 2026 15:53
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@pavelgj pavelgj marked this pull request as draft January 14, 2026 21:19
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.

1 participant