Tool node canvas summary shows raw nodeId for file variable and empty for model-selector parameter
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.7k
- Avg merge
- 21h 41m
- Merged PRs (30d)
- 600
Description
### Self Checks
- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [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, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.
### Dify version
1.16.1
### Cloud or Self Hosted
Self Hosted (Docker)
### Steps to reproduce
1. Create a custom tool plugin with a type: file parameter and a type: model-selector parameter in the tool YAML:
parameters:
- name: input_file
type: file
required: true
form: form
- name: model
type: model-selector
scope: llm
required: true
form: form
2. Add the tool node to a workflow/pipeline.
3. Bind input_file to an upstream File variable, and select a model for model.
4. Observe the node's canvas summary (the preview text at the bottom of the node card).
Root cause:
In web/app/components/workflow/nodes/tool/node.tsx, the generic rendering logic for tool node canvas summary doesn't properly handle:
1. Variable reference values (arrays): input_file's value is [nodeId, varName]. It's rendered via value.join(', '), which shows the raw nodeId. It
should resolve the nodeId to the upstream node's title and render with VariableLabelInNode (like document-extractor/node.tsx does).
2. Model object values: model's value is {provider, model, model_type, mode, completion_params} with type: "constant". None of the typeof checks match,
and the modelSelector type check fails because type is "constant", not FormTypeEnum.modelSelector. It should display value.model (or use ModelSelector
like llm/node.tsx).
Suggested fix:
In tool/node.tsx, add handling for:
- Array values that are variable references → use VariableLabelInNode (or at least show nodeTitle / varName instead of nodeId, varName)
- Object values with a model field → display value.model
Reference: document-extractor/node.tsx uses useNodes() + VariableLabelInNode; llm/node.tsx uses ModelSelector.
---
### ✔️ Expected Behavior
- input_file should display as File / file (upstream node title / variable name), like the built-in Document Extractor node does (using
VariableLabelInNode).
- model should display the model name (e.g. gemma4-31b), like the built-in LLM node does (using ModelSelector).
### ❌ Actual Behavior
- input_file displays as 1785719614025, file — the upstream node's ID (a raw number) is shown via Array.isArray(value) && value.join(', '), instead of
resolving it to the node title.
- model displays empty — the tool_configurations.model.value is an object {provider, model, ...} with type: "constant", which doesn't match any of the
three rendering branches (string / number / array) in tool/node.tsx, nor the modelSelector check (which expects type === FormTypeEnum.modelSelector).
Contributor guide
Research direction
Start in web/app/components/workflow/nodes/tool/node.tsx and trace the canvas-summary rendering for tool_configurations. Compare document-extractor/node.tsx for VariableLabelInNode and llm/node.tsx for model rendering. Done means file variables show the upstream node title and variable name, while model-selector parameters show the selected model name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100