feat(tasks): text input + Honcho persistence
Manual task input box in TaskList component. Tasks persisted to Honcho as JSON preference on every mutation. Tasks loaded from Honcho on identify (session reconnect).
This commit is contained in:
@@ -284,6 +284,12 @@ async def gemini_voice_ws(websocket: WebSocket):
|
||||
# Push updated task list to frontend after any mutation
|
||||
if fn_name in ("add_task", "remove_task", "complete_task", "clear_completed_tasks"):
|
||||
await send_tasks_to_frontend()
|
||||
# Persist to Honcho
|
||||
try:
|
||||
if kira_memory.enabled:
|
||||
kira_memory.set_user_preference(user_id, "tasks", json.dumps(tasks))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Send tool response back to Gemini
|
||||
if tool_results:
|
||||
@@ -332,6 +338,14 @@ async def gemini_voice_ws(websocket: WebSocket):
|
||||
except Exception as e:
|
||||
logger.warning(f"Honcho error during identify: {e}")
|
||||
prefs = {}
|
||||
# Load tasks from Honcho
|
||||
try:
|
||||
saved_tasks = prefs.get("tasks", "")
|
||||
if saved_tasks:
|
||||
tasks.clear()
|
||||
tasks.extend(json.loads(saved_tasks))
|
||||
except Exception:
|
||||
pass
|
||||
await websocket.send_json({
|
||||
"type": "identified",
|
||||
"user_id": user_id,
|
||||
@@ -392,6 +406,19 @@ async def gemini_voice_ws(websocket: WebSocket):
|
||||
if msg_type == "ping":
|
||||
await websocket.send_json({"type": "pong"})
|
||||
|
||||
if msg_type == "add_task":
|
||||
text = msg.get("text", "").strip()
|
||||
if text:
|
||||
result = execute_tool("add_task", {"text": text}, tasks)
|
||||
await send_tasks_to_frontend()
|
||||
# Persist to Honcho
|
||||
try:
|
||||
if kira_memory.enabled:
|
||||
kira_memory.set_user_preference(user_id, "tasks", json.dumps(tasks))
|
||||
except Exception:
|
||||
pass
|
||||
continue
|
||||
|
||||
except WebSocketDisconnect:
|
||||
pass
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user