feat: Add Dify Plugin Integration#158
Conversation
|
Welcome @ifelseend! It looks like this is your first PR to volcano-sh/agentcube 🎉 |
Summary of ChangesHello @ifelseend, 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 Dify's capabilities by integrating AgentCube, an open-source project designed to support and manage AI Agent workloads. The new plugin provides Dify users with a secure and isolated environment to execute code and terminal commands, which is crucial for building advanced agents that require computational tasks. It ensures that users maintain full control over their data by being designed for self-hosted AgentCube instances, and comes with comprehensive documentation and an automated publishing workflow to streamline its adoption and maintenance. Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Dify plugin for AgentCube, which is a valuable addition. The implementation is a good starting point, but I've identified several critical issues that need to be addressed before this can be merged. These include a thread-safety problem in the core tool logic, incorrect session handling that breaks the reuse feature, and a bug in the automated publishing workflow that will cause it to fail. Additionally, there are several high-severity configuration mistakes in the plugin's YAML files that need correction. My detailed comments below provide specific suggestions to resolve these issues.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
=======================================
Coverage ? 35.77%
=======================================
Files ? 29
Lines ? 2549
Branches ? 0
=======================================
Hits ? 912
Misses ? 1511
Partials ? 126
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
77cc687 to
aadd9ef
Compare
hzxuzhonghu
left a comment
There was a problem hiding this comment.
seems it to sync the plugins to https://github.com/langgenius/dify-official-plugins/
My confusion: is that possible to just maintain the source there, keep it here looks not necessary
| on: | ||
| push: | ||
| tags: | ||
| - 'dify-plugin/v*' # Trigger only on plugin-specific tags |
There was a problem hiding this comment.
tags:
- "v*.*.*"
- "v*.*.*-*" # Support for pre-release tags like v1.2.3-alpha
There was a problem hiding this comment.
tags: - "v*.*.*" - "v*.*.*-*" # Support for pre-release tags like v1.2.3-alpha
The dify-plugin-publish.yml workflow has been tested and verified to work correctly.
How to Trigger
The workflow is triggered automatically when a tag matching dify-plugin/v* is pushed:
git tag -a dify-plugin/v<version> -m "Release Dify Plugin v<version>"
git push origin dify-plugin/v<version>
For example:
git tag -a dify-plugin/v0.0.1 -m "Release Dify Plugin v0.0.1"
git push origin dify-plugin/v0.0.1
There was a problem hiding this comment.
Pull request overview
This PR introduces a Dify plugin that integrates AgentCube's code execution capabilities into the Dify platform. The plugin enables users to execute Python code and shell commands in secure sandboxed environments managed by AgentCube.
Changes:
- Added a complete Dify plugin implementation in
integrations/dify-plugin/directory with tool provider, manifest, and documentation - Implemented the AgentCube Code Interpreter tool that wraps the agentcube-sdk for executing code and commands
- Added GitHub Actions workflow for automated plugin packaging and publishing to the Dify plugin marketplace
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
integrations/dify-plugin/tools/agentcube-code-interpreter.yaml |
Tool definition with parameters for language selection, code/command execution, and session management |
integrations/dify-plugin/tools/agentcube-code-interpreter.py |
Python implementation of the code interpreter tool using the agentcube-sdk |
integrations/dify-plugin/provider/agentcube.yaml |
Provider configuration defining the AgentCube tool provider for Dify |
integrations/dify-plugin/provider/agentcube.py |
Provider class with credential validation stub (currently empty) |
integrations/dify-plugin/manifest.yaml |
Plugin manifest defining metadata, permissions, and runtime configuration |
integrations/dify-plugin/main.py |
Entry point that initializes the Dify plugin with 120s timeout |
integrations/dify-plugin/requirements.txt |
Python dependencies including dify-plugin and agentcube-sdk |
integrations/dify-plugin/README.md |
User-facing documentation explaining plugin capabilities and configuration |
integrations/dify-plugin/PRIVACY.md |
Privacy policy clarifying self-hosted deployment and data ownership |
integrations/dify-plugin/GUIDE.md |
Developer guide for Dify plugin development (general reference) |
integrations/dify-plugin/.gitignore |
Python-specific gitignore patterns |
integrations/dify-plugin/.difyignore |
Patterns for excluding files from plugin packaging |
integrations/dify-plugin/.env.example |
Example environment variables for plugin debugging |
integrations/dify-plugin/_assets/icon.png |
Plugin icon for light theme |
integrations/dify-plugin/_assets/icon-dark.png |
Plugin icon for dark theme |
.github/workflows/dify-plugin-publish.yml |
Automated workflow for packaging and publishing plugin on tag push |
The Dify plugin packages are maintained at https://github.com/langgenius/dify-plugins, but the source code for each plugin is maintained by its respective owner. |
integrations/dify-plugin/.gitignore
Outdated
There was a problem hiding this comment.
I donot think we need this, because we have added in the root dir of this repo
There was a problem hiding this comment.
I donot think we need this, because we have added in the root dir of this repo
yes, integrations/dify-plugin/.gitignore is deleted
There was a problem hiding this comment.
what is this file for
you are right, .env.example is deleted
| label: # Required: Multi-language names | ||
| en_US: Plugin Name | ||
| zh_Hans: 插件名称 | ||
| created_at: 2023-01-01T00:00:00Z # Required: Creation time (RFC3339) |
There was a problem hiding this comment.
GUIDE.md is a guide how to develop a Dify plugin, these file is generated by dify SDK,no need to update
| <details> | ||
| <summary><b>3. Testing & Debugging</b></summary> | ||
|
|
||
| 1. Copy `.env.example` to `.env` and configure: |
There was a problem hiding this comment.
configure what? where is REMOTE_INSTALL_KEY from
There was a problem hiding this comment.
configure what? where is
REMOTE_INSTALL_KEYfrom
GUIDE.md update:
> **Note**: The `REMOTE_INSTALL_KEY` can be obtained from your Dify instance's
> plugin debugging settings. Navigate to **Plugins** → **Install from local** →
> **Enable remote debugging** to get your unique debug key.
aadd9ef to
e0217e5
Compare
5dd618a to
262850b
Compare
Workflow VerificationThe dify-plugin-publish.yml workflow has been tested and verified to work correctly. How to TriggerThe workflow is triggered automatically when a tag matching dify-plugin/v* is pushed: For example: Workflow Steps
Prerequisites
@hzxuzhonghu Please review if this workflow setup is acceptable. |
262850b to
f5552ad
Compare
Signed-off-by: ifelseend <1003324934@qq.com>
f5552ad to
f23f573
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This PR introduces the AgentCube Dify Plugin, enabling users to integrate AgentCube's powerful code execution capabilities directly into Dify applications and workflows.
With this plugin, Dify users can leverage AgentCube's secure sandboxes to execute code and terminal commands, making it easier to build advanced agents that require computational capabilities.

Key Features
code_interpreter_idconfigurations.session_id, allowing variables and files to persist across multiple execution steps.router_urlandworkload_manager_url.Changes
intergrations/dify-plugindirectory containing the full plugin source.manifest.yamlandprovider/agentcube.yamlfor Dify plugin definition.tools/agentcube-code-interpreter.yamlandtools/agentcube-code-interpreter.pyimplementing the tool logic usingagentcube-sdk.README.md: Usage guide and configuration details.PRIVACY.md: Privacy policy clarifying data handling for self-hosted deployments.How to Test
intergrationsdirectory.