Fix merged test regressions

This commit is contained in:
pewdiepie-archdaemon
2026-07-01 11:12:55 +00:00
parent a07bbeccf5
commit 2918739489
10 changed files with 24 additions and 9 deletions
+5 -3
View File
@@ -1359,9 +1359,11 @@ def setup_chat_routes(
elif chunk.startswith("event: "):
yield chunk
elif chunk == "data: [DONE]\n\n":
if full_response:
_has_tool_events = bool((last_metrics or {}).get("tool_events"))
if full_response or _has_tool_events:
_response_to_save = full_response or "Done."
_saved_id = save_assistant_response(
sess, session_manager, session, full_response, last_metrics,
sess, session_manager, session, _response_to_save, last_metrics,
character_name=ctx.preset.character_name,
web_sources=web_sources,
rag_sources=ctx.rag_sources,
@@ -1371,7 +1373,7 @@ def setup_chat_routes(
if _saved_id:
yield f'data: {json.dumps({"type": "message_saved", "id": _saved_id})}\n\n'
run_post_response_tasks(
sess, session_manager, session, message, full_response,
sess, session_manager, session, message, _response_to_save,
last_metrics, ctx.uprefs, memory_manager, memory_vector, webhook_manager,
incognito=incognito, compare_mode=compare_mode,
character_name=ctx.preset.character_name,