import sqlite3
db = sqlite3.connect("data/chat.db")
cur = db.execute("DELETE FROM messages WHERE role='assistant' AND trim(coalesce(content,''))=''")
print("Deleted:", cur.rowcount, "empty assistant messages")
db.commit()
db.close()
