fix(honcho): wrap all Honcho calls in try/except (401 key issue)

This commit is contained in:
2026-06-05 23:46:35 -04:00
parent 2da52fbc3c
commit 187c33637a
+7 -3
View File
@@ -187,18 +187,19 @@ async def gemini_voice_ws(websocket: WebSocket):
if msg_type == "identify":
user_id = msg.get("user_id", "default-user").strip()
user_name = msg.get("name", "").strip()
try:
if user_name and user_id:
kira_memory.set_user_preference(user_id, "name", user_name)
prefs = kira_memory.get_user_preferences(user_id)
if kira_memory.enabled:
kira_memory.ensure_peers(user_id)
kira_memory.ensure_session(session_id)
try:
ctx = kira_memory.build_system_prompt_suffix()
if ctx:
memory_suffix = ctx
except Exception:
pass
except Exception as e:
logger.warning(f"Honcho error during identify: {e}")
prefs = {}
await websocket.send_json({
"type": "identified",
"user_id": user_id,
@@ -209,8 +210,11 @@ async def gemini_voice_ws(websocket: WebSocket):
if msg_type == "set_preference":
key = msg.get("key", "").strip()
value = msg.get("value", "").strip()
try:
if key and user_id and user_id != "default-user":
kira_memory.set_user_preference(user_id, key, value)
except Exception:
pass
await websocket.send_json({"type": "preference_saved", "key": key, "success": True})
continue