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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user