`extract_dependencies_from_workflow_graph` produces malformed plugin ids for non-langgenius tools
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in api/services/snippet_dsl_service.py at _extract_dependencies_from_workflow_graph(), especially the TOOL and AGENT branches around lines 577 and 585. Read the docstring and compare the output with analyze_tool_dependency() in services/plugin/dependencies_analysis.py, then add the proposed regression coverage for third-party and missing-provider cases. Done means dependency ids match the documented organization/plugin format and incomplete providers are skipped.
Written by the indexing model from the issue text.
Description
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
main branch (uncommitted)
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
Discovered by peaks-loop code-sweep on 2026-07-02.
- Open any app workflow DSL that contains a TOOL node using a third-party plugin (e.g.
provider="google",provider_type="langgenius") and an AGENT node usingprovider="openai". - Trigger the snippet DSL export path (
api/services/snippet_dsl_service.py:_extract_dependencies_from_workflow_graph). - Inspect the returned
dependencieslist — it contains["google/google", "openai/openai"]instead of the documented["langgenius/google", "langgenius/openai"].
The bug surfaces as malformed plugin ids (google/google) where the two halves of the f-string are the same variable. Downstream check_dependencies silently dropped these ids because they never matched any real plugin, so the bug was invisible until the dependency checker started surfacing real missing-plugin warnings.
✔️ Expected Behavior
Tool/agent dependency ids must follow the documented (organization)/(plugin_name) format:
- For non-langgenius tools:
organization == provider_type,plugin_name == provider_name. - For langgenius tools:
organization == provider_type == "langgenius",plugin_name == provider_name.
This must match the format produced by the sibling helper analyze_tool_dependency() in services/plugin/dependencies_analysis.py (which uses ToolProviderID(tool_id).plugin_id == "(organization)/(plugin_name)") so check_dependencies correctly detects missing plugins.
❌ Actual Behavior
In api/services/snippet_dsl_service.py:577 and :585, the tool and agent branches of _extract_dependencies_from_workflow_graph() both build the dependency id with:
dependencies.append(f"{provider_name}/{provider_name}")
That produces ids like google/google (the two halves of the f-string are the same variable) which never match a real plugin id. The docstring two lines above explicitly states the expected format is ['langgenius/google'].
Introduced during the early Snippet DSL implementation; never fixed because the buggy ids were silently dropped downstream (check_dependencies would just report no leaked deps for the typo output, instead of detecting the actual missing plugin).
Proposed change: Switch both f-strings from f"{provider_name}/{provider_name}" to f"{provider_type}/{provider_name}", which matches the docstring and analyze_tool_dependency()'s output. Add a regression test asserting:
- A graph with a TOOL node using
provider="google"and an AGENT node usingprovider="openai"(bothprovider_type="langgenius") now extracts['langgenius/google', 'langgenius/openai']. - A TOOL node with only
provider_typeset (noprovider) is correctly skipped instead of being appended as a malformed id.
Risk: Only the string format of appended dependency ids is corrected. The function still returns list[str] and is still called by the same two call sites (_extract_dependencies_from_workflow at lines 393 and 534). The buggy output (google/google) was always a no-op downstream — the corrected output may now surface legitimate missing-plugin warnings, which is the intended new behavior. No schema, migration, controller, or frontend changes.
- Dominant language
- TypeScript
- Stars
- 157k
- Forks
- 24.7k
- Avg merge
- 22h 32m
- Merged PRs (30d)
- 611
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from langgenius/dify
-
Annotation Reply: a stored score threshold of 0.0 is silently replaced with 1, disabling the feature Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
langgenius/dify#42639 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
langgenius/dify#42468 · 1 comment · 1 reaction ·
-
🐞 bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
langgenius/dify#42446 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
langgenius/dify#42355 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
langgenius/dify#42350 · 1 comment · 1 reaction ·
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100