personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hopper-hbkn3336-chat-404-race'

+13 -9
+7 -7
apps/chat/call.py
··· 66 66 67 67 title = generate_chat_title(message) 68 68 69 + import convey.state 70 + from apps.utils import get_app_storage_path 71 + from convey.utils import save_json 72 + from think.utils import get_journal, now_ms 73 + 74 + convey.state.journal_root = str(get_journal()) 75 + 69 76 from think.cortex_client import cortex_request 70 77 71 78 config: dict = {} ··· 80 87 if agent_id is None: 81 88 typer.echo("Error: failed to create chat thread", err=True) 82 89 raise typer.Exit(1) 83 - 84 - import convey.state 85 - from apps.utils import get_app_storage_path 86 - from convey.utils import save_json 87 - from think.utils import get_journal, now_ms 88 - 89 - convey.state.journal_root = str(get_journal()) 90 90 91 91 chat_id = agent_id 92 92 ts = now_ms()
+6 -2
apps/chat/routes.py
··· 216 216 else: 217 217 # New chat: create metadata record 218 218 chat_id = agent_id 219 - title = generate_chat_title(message) 219 + fallback_title = message.split("\n")[0][:30] 220 220 chat_record = { 221 221 "ts": ts, 222 222 "facet": facet, 223 223 "provider": provider, 224 224 "muse": "default", 225 - "title": title, 225 + "title": fallback_title, 226 226 "agent_ids": [agent_id], 227 227 } 228 228 chats_dir = get_app_storage_path("chat", "chats") 229 229 save_json(chats_dir / f"{chat_id}.json", chat_record) 230 + title = generate_chat_title(message) 231 + if title != fallback_title: 232 + chat_record["title"] = title 233 + _save_chat(chat_id, chat_record) 230 234 231 235 return jsonify(chat_id=chat_id, agent_id=agent_id) 232 236 except Exception as e: