Skip to content

fix: preserve single-run input variable types#35710

Merged
lyzno1 merged 5 commits into
mainfrom
fix/single-run-number-input-type
May 4, 2026
Merged

fix: preserve single-run input variable types#35710
lyzno1 merged 5 commits into
mainfrom
fix/single-run-number-input-type

Conversation

@Jingyi-Dify
Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes single-step run inputs so referenced variables keep their expected input types instead of falling back to text inputs.

Change List

  • Use value_type as a fallback when a single-run variable cannot be resolved from workflow output metadata.
  • Resolve sys.* variables by their full variable name across available workflow variable groups.
  • Preserve number input behavior for system variables such as sys.timestamp and sys.dialogue_count.

Testing

  • Verified the diff is limited to web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts.
  • Manually checked the affected single-run input paths for normal variables and system variables.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. javascript Pull requests that update javascript code labels Apr 29, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.73%. Comparing base (574d586) to head (656d9e2).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...nts/workflow/nodes/_base/hooks/use-one-step-run.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35710      +/-   ##
==========================================
+ Coverage   85.68%   85.73%   +0.04%     
==========================================
  Files        4460     4458       -2     
  Lines      209183   208973     -210     
  Branches    39040    39040              
==========================================
- Hits       179241   179163      -78     
+ Misses      26779    26645     -134     
- Partials     3163     3165       +2     
Flag Coverage Δ
dify-ui 93.01% <ø> (ø)
web 86.60% <85.71%> (+0.12%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jingyi-Dify Jingyi-Dify force-pushed the fix/single-run-number-input-type branch from 6be3e9c to 11f3673 Compare April 29, 2026 23:15
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 left a comment

Choose a reason for hiding this comment

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

No blocking issues found.

Verified locally:

  • pnpm test app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.ts
  • pnpm type-check
  • pnpm exec eslint app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.ts

Small non-blocking suggestion: consider adding one more fallback test for an unresolved variable with options, asserting it becomes InputVarType.select and preserves options. The implementation already handles this path, but the current spec only covers the number fallback.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 4, 2026
@lyzno1 lyzno1 added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit b43ebf5 May 4, 2026
33 checks passed
@lyzno1 lyzno1 deleted the fix/single-run-number-input-type branch May 4, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants