Skip to content

refactor(py/genkit): remove sync base since we have migrated to async base already#4244

Merged
yesudeep merged 1 commit intomainfrom
yesudeep/refactor/hulking-airplane
Jan 23, 2026
Merged

refactor(py/genkit): remove sync base since we have migrated to async base already#4244
yesudeep merged 1 commit intomainfrom
yesudeep/refactor/hulking-airplane

Conversation

@yesudeep
Copy link
Contributor

@yesudeep yesudeep commented Jan 23, 2026

  • refactor(py/genkit): remove sync base since we have migrated to async base already

@yesudeep yesudeep requested a review from MengqinShen January 23, 2026 21:01
@yesudeep yesudeep marked this pull request as draft January 23, 2026 21:01
@yesudeep yesudeep changed the title yesudeep/refactor/hulking airplane refactor(py/genkit): remove sync base since we have migrated to async base already Jan 23, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yesudeep, 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 undertakes a significant architectural cleanup by fully deprecating and removing the synchronous base components of Genkit, thereby solidifying its asynchronous foundation. Concurrently, it addresses a wide array of type checking inconsistencies and enhances type safety across critical modules. These changes collectively aim to improve the maintainability, robustness, and clarity of the Genkit framework by ensuring a consistent asynchronous paradigm and stricter adherence to type definitions.

Highlights

  • Refactor: Removal of Synchronous Base: The entire synchronous base implementation, GenkitBase, has been removed, along with its associated server-side runtime creation logic. This signifies a complete migration to an asynchronous architecture for Genkit.
  • Enhanced Type Checking and Type Safety: Numerous type checking fixes have been applied across the codebase. This includes adding type: ignore comments for strenum imports on older Python versions, refining type hints for input_type and _AsyncTracingWrapper, and introducing explicit cast calls for clearer type conversions, particularly in environment.py, error.py, plugin.py, and registry.py.
  • Improved Error Handling and Serialization: The GenkitError class now explicitly includes a status attribute, and its initialization logic has been refined. Error details are now serialized using GenkitReflectionApiDetailsWireFormat for better structure and consistency in the reflection API.
  • Streamlined Reflection Server Implementation: The make_reflection_server function and its BaseHTTPRequestHandler-based HTTP server implementation have been removed from genkit/core/reflection.py. This indicates a consolidation towards the ASGI-based reflection server, simplifying the server architecture.
  • Telemetry Data Export Improvements: The default_exporter.py file has been updated to handle startTime and endTime more robustly, ensuring they are always numeric. Additionally, the httpx client's post method now uses the json parameter instead of data=json.dumps(...) for sending telemetry data, which is a more idiomatic and safer approach.

🧠 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.

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.

@yesudeep yesudeep force-pushed the yesudeep/refactor/hulking-airplane branch from 8f9365d to 941c1ec Compare January 23, 2026 21:03
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 refactors the Genkit Python SDK by removing the synchronous base implementation, completing the migration to an asynchronous base. Key changes include the removal of the GenkitBase class and its associated synchronous server components, along with updates to type hints and API usages across several modules. The changes enhance type safety, improve robustness in error handling and action execution, and streamline the reflection server implementation by moving to a Starlette-based ASGI application.

@yesudeep yesudeep force-pushed the yesudeep/refactor/hulking-airplane branch from 941c1ec to 2dd107b Compare January 23, 2026 21:04
@yesudeep yesudeep force-pushed the yesudeep/refactor/hulking-airplane branch from 2dd107b to b7ab324 Compare January 23, 2026 21:11
@yesudeep yesudeep marked this pull request as ready for review January 23, 2026 21:12
@yesudeep yesudeep enabled auto-merge (squash) January 23, 2026 21:14
@yesudeep yesudeep merged commit c986fb5 into main Jan 23, 2026
22 checks passed
@yesudeep yesudeep deleted the yesudeep/refactor/hulking-airplane branch January 23, 2026 21:33
This was referenced Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants