fix: still fighting crashes on close and weird AI chat behaviou

This commit is contained in:
2026-05-02 08:40:36 +02:00
parent 7db8f6d36b
commit 631ceb0521
5 changed files with 93 additions and 11 deletions

View File

@@ -385,12 +385,19 @@ defmodule BDS.AI.Chat do
cond do
chat_user_message_count(conversation_id) < 1 ->
Logger.debug("Chat title generation skipped reason=:no_user_messages")
{:ok, reply}
not generated_chat_title?(conversation.title, conversation.model) ->
Logger.debug(
"Chat title generation skipped reason=:conversation_already_titled title=#{inspect(conversation.title)}"
)
{:ok, reply}
true ->
Logger.debug("Chat title generation requested conversation_id=#{conversation_id}")
case generate_chat_title(user_content, opts) do
{:ok, title} when is_binary(title) and title != "" ->
now = Persistence.now_ms()