Hardcode Python default empty response

This commit is contained in:
Brandon Zhang
2026-03-27 17:54:38 +08:00
parent 8a0dffbcae
commit 372e30ff6f
5 changed files with 22 additions and 25 deletions

View File

@@ -12,6 +12,8 @@ import threading
from contextlib import contextmanager
from typing import Generator
from app.config import DEFAULT_EMPTY_RESPONSE
logger = logging.getLogger(__name__)
# Module-level lock for write serialisation (consume atomicity, settings writes, etc.)
@@ -102,7 +104,7 @@ CREATE TABLE IF NOT EXISTS agent_activity (
_DEFAULT_SETTINGS = {
"default_wait_seconds": "10",
"default_empty_response": "",
"default_empty_response": DEFAULT_EMPTY_RESPONSE,
"agent_stale_after_seconds": "30",
}
@@ -119,6 +121,10 @@ def _seed_defaults(conn: sqlite3.Connection) -> None:
"INSERT OR IGNORE INTO settings (key, value) VALUES (?, ?)",
(key, value),
)
conn.execute(
"UPDATE settings SET value = ? WHERE key = 'default_empty_response' AND value = ''",
(_DEFAULT_SETTINGS["default_empty_response"],),
)
conn.commit()
logger.debug("Default settings seeded")