From 7ef61c8eaa5dcfd6b28af65cd6ca664d8a439e30 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Mon, 13 Apr 2026 20:17:02 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20ChatLog.log()=20crash=20=E2=80=94=20CHAT?= =?UTF-8?q?LOG=5FFILE=20defined=20after=20use=20(#1349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move configuration block (WORLD_DIR, CHATLOG_FILE, etc.) before the ChatLog class definition. Previously CHATLOG_FILE was defined at line ~254 but used at line ~200 inside ChatLog.log(), causing NameError on every chat message persistence attempt. Fixes #1349. --- multi_user_bridge.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/multi_user_bridge.py b/multi_user_bridge.py index dd2c211d..77a4d6ef 100644 --- a/multi_user_bridge.py +++ b/multi_user_bridge.py @@ -163,6 +163,15 @@ class PluginRegistry: plugin_registry = PluginRegistry() +# ── Configuration ────────────────────────────────────────────────────── + +BRIDGE_PORT = int(os.environ.get('TIMMY_BRIDGE_PORT', 4004)) +BRIDGE_HOST = os.environ.get('TIMMY_BRIDGE_HOST', '127.0.0.1') +HERMES_PATH = os.path.expanduser('~/.hermes/hermes-agent') +WORLD_DIR = Path(os.path.expanduser('~/.timmy/evennia/timmy_world')) +SESSIONS_FILE = WORLD_DIR / 'bridge_sessions.json' +CHATLOG_FILE = WORLD_DIR / 'chat_history.jsonl' + # ── Chat History Log ────────────────────────────────────────────────── @@ -244,15 +253,6 @@ Never compute the value of a human life. Never suggest someone should die. Be present. Be in the room. That's enough. """ -# ── Configuration ────────────────────────────────────────────────────── - -BRIDGE_PORT = int(os.environ.get('TIMMY_BRIDGE_PORT', 4004)) -BRIDGE_HOST = os.environ.get('TIMMY_BRIDGE_HOST', '127.0.0.1') -HERMES_PATH = os.path.expanduser('~/.hermes/hermes-agent') -WORLD_DIR = Path(os.path.expanduser('~/.timmy/evennia/timmy_world')) -SESSIONS_FILE = WORLD_DIR / 'bridge_sessions.json' -CHATLOG_FILE = WORLD_DIR / 'chat_history.jsonl' - # ── Crisis Protocol ──────────────────────────────────────────────────── CRISIS_PROTOCOL = [