Skip to content

Commit 56673ad

Browse files
committed
fix: prevent duplicate result content type after streaming finishes in RespondStage
1 parent 9a4d05e commit 56673ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

astrbot/core/pipeline/respond/stage.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ async def process(
158158
result = event.get_result()
159159
if result is None:
160160
return
161+
if event.get_extra("_streaming_finished", False):
162+
# prevent some plugin make result content type to LLM_RESULT after streaming finished, lead to send again
163+
return
161164
if result.result_content_type == ResultContentType.STREAMING_FINISH:
165+
event.set_extra("_streaming_finished", True)
162166
return
163167

164168
logger.info(

0 commit comments

Comments
 (0)