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 2026-09-30 17:03:01 +02:00 • committed by GitHub
parent 9b45bedeaf
commit fa66b0f306
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

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()

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: