Apply or Config.OLLAMA_MODEL safety net to assist route

The same empty-string model guard added to chat.py was missing from the
notes assist route. If default_model was stored as "" in the DB, the
assist route would pass "" to Ollama which responds with 400, surfaced
to the user as a "400" error in the assist panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 21:04:53 -05:00
parent 5c043b76b6
commit 31777ae66b
+1 -1
View File
@@ -259,7 +259,7 @@ async def assist_route():
if existing and existing.state == GenerationState.RUNNING:
return jsonify({"error": "Assist generation already running"}), 409
model = await get_setting(uid, "default_model", Config.OLLAMA_MODEL)
model = await get_setting(uid, "default_model", Config.OLLAMA_MODEL) or Config.OLLAMA_MODEL
messages = build_assist_messages(body, target_section, instruction)
buf = create_assist_buffer(uid)