Skip to content

feat: add uv sync offline flag#623

Closed
fatelei wants to merge 2 commits into
langgenius:mainfrom
fatelei:issue-615
Closed

feat: add uv sync offline flag#623
fatelei wants to merge 2 commits into
langgenius:mainfrom
fatelei:issue-615

Conversation

@fatelei

@fatelei fatelei commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Description

fix #615

use dify package generate bundle plugin, allow not download dep from pypi

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 Mar 5, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 plugin management system by introducing an "offline" mode for uv sync when dealing with manually uploaded plugins. This change addresses issue #615 by ensuring that bundled plugins, which are expected to have their dependencies already present, do not attempt to download them from PyPI. The system now tracks the upload method of plugins using a cache, allowing for more efficient and reliable dependency resolution, particularly in environments where external network access might be restricted or undesirable for pre-packaged plugins.

Highlights

  • Offline Dependency Synchronization: Introduced a mechanism to use the --offline flag with uv sync when installing dependencies for manually uploaded (bundled) plugins. This prevents unnecessary downloads from PyPI, optimizing installation for plugins that already include their dependencies.
  • Plugin Upload Status Tracking: Implemented caching to track whether a plugin was manually uploaded. This status is then used to determine if the --offline flag should be applied during dependency synchronization.
  • Code Formatting and Import Reordering: Applied consistent formatting and reordered import statements across several generated Go files and other core components, improving code readability and adherence to style guidelines.

🧠 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
  • internal/core/io_tunnel/backwards_invocation/transaction/serverless_handler_test.go
    • Adjusted whitespace and formatting in test constants and error messages.
  • internal/core/io_tunnel/datasource.gen.go
    • Reordered import statements.
  • internal/core/io_tunnel/dynamic_parameter.gen.go
    • Reordered import statements.
  • internal/core/io_tunnel/model.gen.go
    • Reordered import statements.
  • internal/core/io_tunnel/oauth.gen.go
    • Reordered import statements.
  • internal/core/io_tunnel/tool.gen.go
    • Reordered import statements.
  • internal/core/io_tunnel/trigger.gen.go
    • Reordered import statements.
  • internal/core/local_runtime/constructor.go
    • Corrected indentation for struct initialization.
  • internal/core/local_runtime/environment_python.go
    • Corrected indentation for a tracing span call.
  • internal/core/local_runtime/setup_python_environment.go
    • Implemented conditional --offline flag for uv sync based on plugin upload status.
  • internal/core/local_runtime/subprocess.go
    • Added isManuallyUploaded method to determine if a plugin was manually uploaded, utilizing a cache for this check.
    • Imported the cache package.
  • internal/core/plugin_manager/packages.go
    • Integrated cache to mark manually uploaded plugins upon saving.
    • Refined database error handling using errors.Is.
    • Imported the cache package.
  • internal/server/http_server.go
    • Corrected indentation for Gin engine initialization.
  • internal/service/datasource.gen.go
    • Reordered import statements.
  • internal/service/dynamic_parameter.gen.go
    • Reordered import statements.
  • internal/service/model.gen.go
    • Reordered import statements.
  • internal/service/oauth.gen.go
    • Reordered import statements.
  • internal/service/tool.gen.go
    • Reordered import statements.
  • internal/service/trigger.gen.go
    • Reordered import statements.
  • internal/types/models/curd/install_concurrency_test.go
    • Removed trailing newline character from file.
Activity
  • The author has indicated this PR includes both a bug fix and a new feature.
  • Local testing has been completed and confirmed to work as expected.
  • The changes address and close issue offline plugin install failed #615.
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.

@dosubot dosubot Bot added bug Something isn't working plugin-daemon labels Mar 5, 2026

@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 an --offline flag for uv sync to support offline installation of manually uploaded plugins. However, a critical vulnerability has been identified: a mismatch in cache key construction and incompatible cache methods (AutoSet vs Get) prevents the manually_uploaded flag from being correctly detected. This bypasses the intended offline mode, potentially leading to unauthorized network access during plugin installation. Additionally, the cache key has a short, 30-minute expiration which is likely insufficient. Addressing these cache-related issues is crucial for the feature to work as intended and to prevent potential security risks.

Comment thread internal/core/plugin_manager/packages.go Outdated
Comment thread internal/core/local_runtime/subprocess.go Outdated
Comment thread internal/core/local_runtime/subprocess.go
Comment thread internal/core/plugin_manager/packages.go
@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 Mar 5, 2026
@fatelei fatelei force-pushed the issue-615 branch 2 times, most recently from f892cd3 to 9bd0af1 Compare March 5, 2026 04:18

@Stream29 Stream29 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.

We'd better split the formatting into another PR.

@fatelei

fatelei commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

We'd better split the formatting into another PR.

ok

@fatelei fatelei closed this Mar 5, 2026
@fatelei fatelei deleted the issue-615 branch March 5, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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.

offline plugin install failed

2 participants