fix: background sub-agent and timer replies only show in the open chat after a page reload (#31576)

When a sub-agent running in the background finished, or a timer the model set went off, the result and the model's follow-up reply were saved but did not show in the chat the user had open. They only appeared after a manual page reload. They now show in the open chat as soon as they arrive.

Fixes #31566
This commit is contained in:
Classic298 authored and GitHub committed 2026-09-30 19:03:01 +04:00
1 parent 9b45bedeaf
commit fa66b0f306
2 files changed
+2

No files matched your search

+1
View File
@@ -219,6 +219,7 @@ async def process_pending_internal_messages(
history['messages'] = messages
history['currentId'] = assistant_message_id
chat.chat = {**(chat.chat or {}), 'history': history}
chat.current_message_id = assistant_message_id
chat.updated_at = int(time.time())
await db.commit()
+1
View File
@@ -351,6 +351,7 @@ async def execute_due_timer(app, timer_id: str, claim_id: str | None = None) ->
parent.chat = parent_chat
history['currentId'] = assistant_message_id
parent.current_message_id = assistant_message_id
parent.updated_at = int(time.time())
timer_row = await db.get(Chat, timer_id)
if timer_row: