Skip to content

feat(tool): support conditional parameter visibility - #323

Merged
WH-2099 merged 3 commits into
langgenius:mainfrom
zyqzyq:feat/add_show_on
Aug 4, 2026
Merged

feat(tool): support conditional parameter visibility#323
WH-2099 merged 3 commits into
langgenius:mainfrom
zyqzyq:feat/add_show_on

Conversation

@zyqzyq

@zyqzyq zyqzyq commented May 14, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks:

Compatibility Check

Part of langgenius/dify#36141.

  • I have checked whether this change affects the backward compatibility of the plugin declared in README.md
  • I have checked whether this change affects the forward compatibility of the plugin declared in README.md
  • If this change introduces a breaking change, I have discussed it with the project maintainer and specified the release version in the README.md
  • I have described the compatibility impact and the corresponding version number in the PR description
  • I have checked whether the plugin version is updated in the README.md

Available Checks

  • just build has passed
  • Relevant documentation has been updated (if necessary)

No documentation or version update is needed for this additive schema change.

Summary

Tool parameters and their select options now preserve optional show_on conditions from plugin YAML.
Both fields default to an empty list so existing manifests remain unchanged.
A focused round-trip test covers parameter-level conditions, option-level conditions, and omitted fields.

Compatibility impact

This is an additive SDK schema change with no public method or runtime protocol removal.
Existing manifests continue to validate with empty show_on lists.
End-to-end UI support remains coordinated with langgenius/dify#36148 and langgenius/dify-plugin-daemon#732.

Validation

  • uv run pytest tests/entities/test_tool.py -q (5 passed)
  • just docs
  • just check
  • just test (185 passed, 1 skipped)
  • just build

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a show_on field to the tool parameter configuration, enabling conditional display logic for parameters. The reviewer suggested adding a description attribute to this new field to maintain consistency with existing fields and ensure proper documentation generation.

Comment thread src/dify_plugin/entities/tool.py Outdated
@WH-2099 WH-2099 self-assigned this Jul 31, 2026
@WH-2099 WH-2099 changed the title add show_on to ToolParameter feat(tool): support conditional parameter visibility Jul 31, 2026

@WH-2099 WH-2099 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the schema contract against langgenius/dify#36148 and langgenius/dify-plugin-daemon#732. Field names, nesting, defaults, and the variable/value shape match. Local just check, just test, and just docs all pass; no blocking findings.

@WH-2099
WH-2099 enabled auto-merge (squash) August 4, 2026 08:28
@WH-2099
WH-2099 merged commit f65af63 into langgenius:main Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants