Skip to content

feat: Add Dify Plugin Integration#158

Merged
volcano-sh-bot merged 1 commit intovolcano-sh:mainfrom
ifelseend:dify-plugin
Feb 5, 2026
Merged

feat: Add Dify Plugin Integration#158
volcano-sh-bot merged 1 commit intovolcano-sh:mainfrom
ifelseend:dify-plugin

Conversation

@ifelseend
Copy link
Copy Markdown
Contributor

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.
截屏2026-01-22 21 19 36

截屏2026-01-22 21 18 40

Key Features

  • AgentCube Code Interpreter Tool: A new tool integrated into Dify that provides an isolated environment for execution.
  • Flexible Language Support:
    • Python: Supported out-of-the-box using the built-in interpreter.
    • Custom Languages: Support for JavaScript, TypeScript, and others via custom code_interpreter_id configurations.
  • Session Management: Supports stateful interactions via session_id, allowing variables and files to persist across multiple execution steps.
  • Secure Configuration: Designed for self-hosted AgentCube instances with configurable router_url and workload_manager_url.

Changes

  • Added intergrations/dify-plugin directory containing the full plugin source.
  • Implemented manifest.yaml and provider/agentcube.yaml for Dify plugin definition.
  • Added tools/agentcube-code-interpreter.yaml and tools/agentcube-code-interpreter.py implementing the tool logic using agentcube-sdk.
  • Added documentation:
    • README.md: Usage guide and configuration details.
    • PRIVACY.md: Privacy policy clarifying data handling for self-hosted deployments.

How to Test

  1. Navigate to the intergrations directory.
  2. Package the plugin:
    dify plugin package ./dify-plugin

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

Welcome @ifelseend! It looks like this is your first PR to volcano-sh/agentcube 🎉

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 Dify Plugin Integration: This pull request introduces the AgentCube Dify Plugin, enabling Dify applications and workflows to integrate with AgentCube's code execution capabilities.
  • AgentCube Code Interpreter Tool: A new tool, the AgentCube Code Interpreter, is added to Dify, providing an isolated sandbox for executing code and terminal commands.
  • Flexible Language Support: The plugin supports Python out-of-the-box and allows for custom languages like JavaScript and TypeScript through code_interpreter_id configurations.
  • Session Management: The tool incorporates session management via session_id, allowing variables and files to persist across multiple execution steps for stateful interactions.
  • Automated Publishing Workflow: A GitHub Actions workflow is included to automate the packaging and creation of pull requests for publishing the Dify plugin upon release.
  • Comprehensive Documentation: Detailed documentation, including a README.md for usage, a PRIVACY.md outlining data handling for self-hosted deployments, and a GUIDE.md for plugin development, has been added.

🧠 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
Copy Markdown
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 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-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 22, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@ecea52a). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #158   +/-   ##
=======================================
  Coverage        ?   35.77%           
=======================================
  Files           ?       29           
  Lines           ?     2549           
  Branches        ?        0           
=======================================
  Hits            ?      912           
  Misses          ?     1511           
  Partials        ?      126           
Flag Coverage Δ
unittests 35.77% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tags:
  - "v*.*.*"
  - "v*.*.*-*" # Support for pre-release tags like v1.2.3-alpha

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@ifelseend
Copy link
Copy Markdown
Contributor Author

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I donot think we need this, because we have added in the root dir of this repo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I donot think we need this, because we have added in the root dir of this repo

yes, integrations/dify-plugin/.gitignore is deleted

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what is this file for

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

update

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

configure what? where is REMOTE_INSTALL_KEY from

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

configure what? where is REMOTE_INSTALL_KEY from

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 12 comments.

@ifelseend ifelseend force-pushed the dify-plugin branch 2 times, most recently from 5dd618a to 262850b Compare February 4, 2026 09:24
@ifelseend
Copy link
Copy Markdown
Contributor Author

Workflow Verification

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

Workflow Steps

  1. Downloads the Dify plugin CLI tool
  2. Installs yq for robust YAML parsing
  3. Extracts plugin metadata (name, version, author) from
  4. manifest.yaml
  5. Packages the plugin as a .difypkg file
  6. Creates a PR to langgenius/dify-plugins via the author's fork

Prerequisites

  • A PLUGIN_ACTION secret must be configured with a GitHub PAT that has repo permissions
  • The author (specified in manifest.yaml) must have a fork of langgenius/dify-plugins

@hzxuzhonghu Please review if this workflow setup is acceptable.

Signed-off-by: ifelseend <1003324934@qq.com>
Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit a9797e0 into volcano-sh:main Feb 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants