Skip to content

fix: handle cleared optional file tool inputs#39195

Open
stevenup wants to merge 5 commits into
langgenius:mainfrom
leo-digital:fix/39045-optional-file-clear
Open

fix: handle cleared optional file tool inputs#39195
stevenup wants to merge 5 commits into
langgenius:mainfrom
leo-digital:fix/39045-optional-file-clear

Conversation

@stevenup

@stevenup stevenup commented Jul 17, 2026

Copy link
Copy Markdown

Summary

  • Reset cleared optional file and files form inputs to an unset null constant in the workflow editor.
  • Ignore legacy empty optional variable selectors at runtime while preserving validation for required and malformed non-empty selectors.
  • Add frontend and backend regression coverage for empty-string and empty-list selector states.

Fixes #39045

Screenshots

Not applicable. This is a behavioral fix with no visual UI changes.

Test plan

  • uv run --project api pytest api/tests/unit_tests/core/tools/test_tool_manager.py -q (50 passed)
  • make lint && make type-check
  • cd web && pnpm test app/components/workflow/nodes/_base/components/__tests__/form-input-item.branches.spec.tsx app/components/workflow/nodes/_base/components/__tests__/form-input-item.spec.tsx (17 passed)
  • cd web && pnpm exec vp staged --cwd .. --diff upstream/main...HEAD --fail-on-changes
  • git diff --check upstream/main...HEAD

Checklist

  • This change does not require a documentation update.
  • 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.
  • Documentation is unchanged because this fix does not alter user-facing configuration or APIs.
  • I ran make lint && make type-check (backend) and the frontend staged checks for the full PR diff.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 17, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Bug: Clearing an optional file input in a tool node saves an invalid variable value

1 participant