How Do I Modify the Source Code of the Agent Plugin? #13174

Closed
opened 2026-02-21 19:10:54 -05:00 by yindo · 3 comments
Owner

Originally created by @lishuyangg on GitHub (Apr 21, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

How Do I Modify the Source Code of the Agent Plugin,like dify_plugin.core.runtime.py

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @lishuyangg on GitHub (Apr 21, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. How Do I Modify the Source Code of the Agent Plugin,like dify_plugin.core.runtime.py ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🤖 feat:agent label 2026-02-21 19:10:54 -05:00
yindo closed this issue 2026-02-21 19:10:54 -05:00
Author
Owner

@lishuyangg commented on GitHub (Apr 21, 2025):

An API tool requires dynamic token authentication. How to transfer a dynamic token when the agent node invokes the tool?

@lishuyangg commented on GitHub (Apr 21, 2025): An API tool requires dynamic token authentication. How to transfer a dynamic token when the agent node invokes the tool?
Author
Owner

@dosubot[bot] commented on GitHub (Apr 21, 2025):

To modify the source code of the agent plugin, such as the dify_plugin.core.runtime.py file, you would typically follow these general steps:

  1. Clone the Repository: Start by cloning the Dify repository to your local machine if you haven't already. This will give you access to the source code.

  2. Locate the File: Navigate to the directory where the dify_plugin.core.runtime.py file is located. You can use a code editor to open and edit the file.

  3. Make Your Changes: Edit the file as needed. Ensure that you understand the existing code structure and logic to make effective modifications.

  4. Test Your Changes: After making changes, it's important to test them to ensure they work as expected. You might need to set up a local development environment for this purpose.

  5. Deploy the Changes: Once you're satisfied with the changes, you can deploy them. This might involve pushing the changes to a branch in the repository and following any deployment processes specific to your setup.

Regarding transferring a dynamic token when the agent node invokes a tool, the dynamic token is passed in the invoke_llm method within the tools parameter. This is part of the data payload sent in the _request_with_plugin_daemon_response_stream function call [1]. You can modify this part of the code to handle dynamic token authentication as needed.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 21, 2025): <!-- Answer --> To modify the source code of the agent plugin, such as the `dify_plugin.core.runtime.py` file, you would typically follow these general steps: 1. **Clone the Repository**: Start by cloning the Dify repository to your local machine if you haven't already. This will give you access to the source code. 2. **Locate the File**: Navigate to the directory where the `dify_plugin.core.runtime.py` file is located. You can use a code editor to open and edit the file. 3. **Make Your Changes**: Edit the file as needed. Ensure that you understand the existing code structure and logic to make effective modifications. 4. **Test Your Changes**: After making changes, it's important to test them to ensure they work as expected. You might need to set up a local development environment for this purpose. 5. **Deploy the Changes**: Once you're satisfied with the changes, you can deploy them. This might involve pushing the changes to a branch in the repository and following any deployment processes specific to your setup. Regarding transferring a dynamic token when the agent node invokes a tool, the dynamic token is passed in the `invoke_llm` method within the `tools` parameter. This is part of the data payload sent in the `_request_with_plugin_daemon_response_stream` function call <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/plugin/manager/model.py)</sup>. You can modify this part of the code to handle dynamic token authentication as needed. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/33797599-8359-4cb6-9b0c-0f58d54fe5da?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 21, 2025):

See this repo, for changes regarding the Agent, you need to change the source code here https://github.com/langgenius/dify-official-plugins

@crazywoola commented on GitHub (Apr 21, 2025): See this repo, for changes regarding the Agent, you need to change the source code here https://github.com/langgenius/dify-official-plugins
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13174