From 76c384ea53b5d47c1069004294fc4e482c3bb59e Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 2 Mar 2026 22:44:14 -0500 Subject: [PATCH] Fix chat model always using conv.model instead of user setting conv.model was stored at conversation creation time and short-circuited the get_setting() call, so changing default_model in Settings had no effect on existing conversations. Now the user's default_model setting is always the source of truth for generation and summarization. Co-Authored-By: Claude Sonnet 4.6 --- src/fabledassistant/routes/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabledassistant/routes/chat.py b/src/fabledassistant/routes/chat.py index 87b3351..acd6aa9 100644 --- a/src/fabledassistant/routes/chat.py +++ b/src/fabledassistant/routes/chat.py @@ -136,7 +136,7 @@ async def send_message_route(conv_id: int): if msg.role != "system": history.append({"role": msg.role, "content": msg.content}) - model = conv.model or await get_setting(uid, "default_model", Config.OLLAMA_MODEL) or Config.OLLAMA_MODEL + model = await get_setting(uid, "default_model", Config.OLLAMA_MODEL) or Config.OLLAMA_MODEL # Launch background generation task (context building happens inside the task) asyncio.create_task(run_generation( @@ -259,7 +259,7 @@ async def summarize_conversation_route(conv_id: int): conv = await get_conversation(uid, conv_id) if conv is None: return jsonify({"error": "Conversation not found"}), 404 - model = conv.model or await get_setting(uid, "default_model", Config.OLLAMA_MODEL) or Config.OLLAMA_MODEL + model = await get_setting(uid, "default_model", Config.OLLAMA_MODEL) or Config.OLLAMA_MODEL try: note = await summarize_conversation_as_note(uid, conv_id, model) return jsonify(note), 201