fix(gateway): honor previewed replies in queued follow-ups

This commit is contained in:
Dave Tist
2026-04-16 14:06:38 +02:00
committed by Teknium
parent d67e602cc8
commit 35bbc6851b
2 changed files with 19 additions and 2 deletions

View File

@@ -9396,8 +9396,10 @@ class GatewayRunner:
pass
except Exception as e:
logger.debug("Stream consumer wait before queued message failed: %s", e)
_previewed = bool(result.get("response_previewed"))
_already_streamed = bool(
_sc and getattr(_sc, "final_response_sent", False)
(_sc and getattr(_sc, "final_response_sent", False))
or _previewed
)
first_response = result.get("final_response", "")
if first_response and not _already_streamed: