Skip to content

Conversation

@fatelei
Copy link
Contributor

@fatelei fatelei commented Jan 22, 2026

Description

fix #575

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 22, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @fatelei, 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 significantly enhances the robustness of plugin management by making the plugin installation process idempotent. It achieves this by implementing sophisticated error handling for concurrent database operations, specifically targeting PostgreSQL unique constraint violations. Furthermore, it improves the reliability of local plugin execution by ensuring that all necessary files are present and runtimes are active within the request middleware. These changes collectively contribute to a more stable and predictable plugin ecosystem.

Highlights

  • Idempotent Plugin Installation: The SavePackage function in plugin_manager is updated to handle concurrent plugin creation attempts, preventing errors from duplicate entries in the database by ignoring unique constraint violations and performing a read-after-write.
  • PostgreSQL Unique Constraint Handling: A new helper function, isUniqueViolation, is introduced to specifically detect and manage PostgreSQL unique constraint violation errors (SQLSTATE 23505), allowing for graceful recovery during concurrent inserts.
  • Local Plugin Runtime Assurance: The FetchPluginInstallation middleware now includes logic to ensure that local plugin files are installed and their runtimes are launched before proceeding with requests for non-remote plugins, preventing potential runtime errors.
  • Import Statement Reordering: Several generated io_tunnel and service files have their import statements reordered for consistency and tidiness, improving code readability.

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

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

The pull request introduces idempotency for plugin installation, which is a significant improvement for handling concurrent operations. The new isUniqueViolation helper function correctly identifies PostgreSQL unique constraint errors, and the retry logic ensures that concurrent CREATE operations are handled gracefully. Additionally, the middleware now includes a crucial check to ensure local plugin runtimes are properly launched before processing requests, enhancing the overall stability and reliability of the system.

Copy link
Contributor

@Stream29 Stream29 left a comment

Choose a reason for hiding this comment

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

Generated files should not be modified. It's better to regenerate them.

@fatelei
Copy link
Contributor Author

fatelei commented Jan 22, 2026

Generated files should not be modified. It's better to regenerate them.

revert

@Stream29
Copy link
Contributor

Is it possible to test this behavior? It's better to have a test to guarantee the correctness.
@fatelei

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 23, 2026
@fatelei
Copy link
Contributor Author

fatelei commented Jan 23, 2026

Is it possible to test this behavior? It's better to have a test to guarantee the correctness. @fatelei

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin-daemon size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install plugin should be idempotent

2 participants