feat: Persist user input content to session in live mode

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 859207592
This commit is contained in:
Xiang (Sean) Zhou
2026-01-21 12:11:01 -08:00
committed by Copybara-Service
parent 5d941460b6
commit a04828dd8a
3 changed files with 111 additions and 2 deletions
+4
View File
@@ -409,6 +409,10 @@ class MockLlmConnection(BaseLlmConnection):
async def receive(self) -> AsyncGenerator[LlmResponse, None]:
"""Yield each of the pre-defined LlmResponses."""
for response in self.llm_responses:
# Yield control to allow other tasks (like send_task) to run first.
# This ensures user content gets persisted before the mock response
# is yielded.
await asyncio.sleep(0)
yield response
async def close(self):