fix: variable assigner can't assign float number (#28068)

This commit is contained in:
非法操作 2025-11-12 19:27:36 +08:00 committed by GitHub
parent 1369119a0c
commit 6026bd873b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -808,7 +808,11 @@ class DraftVariableSaver:
# We only save conversation variable here.
if selector[0] != CONVERSATION_VARIABLE_NODE_ID:
continue
segment = WorkflowDraftVariable.build_segment_with_type(segment_type=item.value_type, value=item.new_value)
# Conversation variables are exposed as NUMBER in the UI even if their
# persisted type is INTEGER. Allow float updates by loosening the type
# to NUMBER here so downstream storage infers the precise subtype.
segment_type = SegmentType.NUMBER if item.value_type == SegmentType.INTEGER else item.value_type
segment = WorkflowDraftVariable.build_segment_with_type(segment_type=segment_type, value=item.new_value)
draft_vars.append(
WorkflowDraftVariable.new_conversation_variable(
app_id=self._app_id,