Skip to content

fix(web): propagate boolean model parameter changes - #42646

Open
iuiu-py wants to merge 1 commit into
langgenius:mainfrom
iuiu-py:fix/boolean-parameter-false
Open

iuiu-py wants to merge 1 commit into
langgenius:mainfrom
iuiu-py:fix/boolean-parameter-false

Conversation

@iuiu-py

@iuiu-py iuiu-py commented Sep 21, 2026

Copy link
Copy Markdown

Summary

Fixes #42637

For optional boolean model parameters that have no saved value yet, the first True/False selection only updated the component's local state. The parent was not notified because the propagation check treated the parameter as unset. This made it impossible to persist an explicit false value, such as disabling Ollama thinking mode.

This change always propagates user selections for boolean parameters. Other optional parameter types keep their existing lazy-initialization behavior.

Testing

  • Added a regression test for an unset optional boolean parameter whose displayed default is true; selecting False now calls onChange(false).
  • Confirmed RED: the focused new test failed with expected "vi.fn()" to be called 1 times, but got 0 times.
  • Confirmed GREEN: parameter-item.spec.tsx passes with 22 tests.
  • Ran focused Oxlint and vp staged successfully.
  • Running pnpm run type-check in web fails locally in dev-proxy.config.ts because the skipped @langgenius/dev-proxy workspace prepare/build step did not produce the workspace package; it is unrelated to the touched files.

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 verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I've updated the documentation accordingly.
  • I ran focused frontend checks and vp staged for the changed files.

This PR was prepared with AI assistance and reviewed by the submitting account. Please consider adding the llm-generated label.

From Codex

Optional boolean parameters started with no saved value, so the first True/False selection only updated local state. Always propagate boolean input changes so False can be persisted explicitly.
@github-actions github-actions Bot added the web This relates to changes on the web. label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Boolean model parameter with false value is dropped on save, making it impossible to explicitly disable ollama thinking mode

1 participant