[Chore] redundant acceptedKeys check in completion-params.ts #16130

Closed
opened 2026-02-21 19:24:45 -05:00 by yindo · 0 comments
Owner

Originally created by @hyongtao-code on GitHub (Aug 13, 2025).

Currently, mergeValidCompletionParams maintains both acceptedKeys (a Set of rule names) and ruleMap (a mapping from rule name to rule object) to check whether a key is supported. Both data structures are built from the same rules array, so their existence checks are equivalent. This results in duplicate maintenance and redundant logic.

https://github.com/langgenius/dify/blob/main/web/utils/completion-params.ts#L20-L30

Originally created by @hyongtao-code on GitHub (Aug 13, 2025). Currently, `mergeValidCompletionParams` maintains both `acceptedKeys` (a Set of rule names) and `ruleMap` (a mapping from rule name to rule object) to check whether a key is supported. Both data structures are built from the same rules array, so their existence checks are equivalent. This results in duplicate maintenance and redundant logic. https://github.com/langgenius/dify/blob/main/web/utils/completion-params.ts#L20-L30
yindo closed this issue 2026-02-21 19:24:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16130